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: Determine Mouse Position
Question | 1 Answer
Delphi/Lazarus: Is the ALT, SHIFT or CTRL key pressed?
Tutorial | 0 Comments
Delphi/Lazarus: Go through Array independent from Index
Question | 1 Answer
Delphi/Lazarus: Determine System Date Format
Question | 1 Answer
Delphi: Show Path in Windows Explorer
Question | 1 Answer
Delphi/Lazarus: Date of tomorrow
Question | 1 Answer
Delphi/Lazarus: Difference between ParamStr(0) and Application.ExeName
Question | 1 Answer
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