Delphi/Lazarus: Determine ShiftState
Question by Guest | 2016-04-30 at 22:54
When creating a procedure such as OnKeyDown, OnKeyPress, OnMouseDown, OnMouseMove or OnMouseUp in Delphi or Lazarus, there is always a variable called Shift of the type TShiftState available, holding the recent state of the keys CTRL, ALT and SHIFT and even some information about the current mouse keys.
However, this information is not available in most of the other procedures (OnClick, OnDblClick, OnKeyPress, OnMouseLeave etc). What can I do to make the current shift state also available in those procedures or even at an arbitrary other point of my program code?
Related Topics
Delphi/Lazarus: Is the ALT, SHIFT or CTRL key pressed?
Tutorial | 0 Comments
Delphi/Lazarus: How to set up a Link to a Website in an Application
Tutorial | 0 Comments
Delphi/Lazarus: 3 Ways to round a Number to X Decimal Places
Tutorial | 7 Comments
Delphi/Lazarus: Command Line Parameter Tutorial Part 1: Sending
Tutorial | 0 Comments
Delphi: Global Treatment of Errors (Exceptions)
Tutorial | 0 Comments
Delphi: Multiline Caption for TLabel (at Run Time and Design Time)
Tutorial | 1 Comment
Delphi/Lazarus: Delete selected Items from ListBox using DEL-Key
Tip | 3 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
You can always fetch the current state of ShiftState by using the function GetKeyShiftState.
Here is an example:
More information about the ShiftState, you can get here.
2016-04-30 at 22:56