Home > Back-end >  Delphi is how to determine the global hotkeys state press or bounce?
Delphi is how to determine the global hotkeys state press or bounce?

Time:09-25

In the form can be judged by FormKeyDown or FormKeyUp button state, I would like to ask, global hotkeys whether can achieve the same function?
For example defines the global hot key Ctrl + Alt + Q, when press on display form, such as loose, hidden form,

Thank you, please help!

CodePudding user response:

Use the keyboard hook hook

CodePudding user response:

Hot key is not so easy to use, there would be only one result is the user press the hotkey, no distinction between press and release so carefully.

CodePudding user response:

Just want to ask how to distinguish between the press and let go, if we can only judge according to the, that doesn't need to trouble you,

CodePudding user response:

SetWindowsHookEx set a WH_KEYBOARD type of hook, the callback KeyboardProc function parameters of the highest lParam (bit31) indicates a key press status (0 press, 1 open), also can use WH_KEYBOARD_LL type of hook, of course the lParam LowLevelKeyboardProc function parameter of the callback to a KBDLLHOOKSTRUCT structure, one of the flags bit7 indicates a key press state (0 press, 1 open),

CodePudding user response:

The original poster you need to have a clear concept of an operating system buttons,
1, the operating system does not exist long press the button, or let go of the two state;
2, the operating system, when a key press or let go of, will only respond to an event;
3, as for firing event is the key, don't pass judgment, to know,
  • Related