The library allows to create HotKey Input control by using the low-level keyboard hook. This UDF is designed specially to support the HotKey UDF library but it can be used separately. Please look at the example below to understand how it works. For more information, see detailed descriptions of all functions inside HotKeyInput.au3.
If you run the example, and you press "CTRL + ALT + SHIFT" (CAS) and then "D" key, it writes "CAS - D". It works as it is supposed to.
But if you press CAS+D, release D and A, and again press D it writes "CAS - D", but you didn't pressed A. Same with S.
If you run the example, and you press "CTRL + ALT + SHIFT" (CAS) and then "D" key, it writes "CAS - D". It works as it is supposed to. But if you press CAS+D, release D and A, and again press D it writes "CAS - D", but you didn't pressed A. Same with S.
Cheers!
Thank you for your reply.
This is not a bug. HotKey combination fixed after pressing function key ("D"). To clear it is necessary to release all the keys have been pressed ("CAS"). I did it for safe use.
_GUICtrlReadHotKeyInput() returns the combined 16-bit hotkey code, which consists of upper and lower bytes.
Hotkey code bits:
0-7 - Specifies the virtual-key (VK) code of the key. Codes for the mouse buttons (0x01 - 0x06) are not supported. For more information see this. 8 - SHIFT key 9 - CONTROL key 10 - ALT key 11 - WIN key 12-15 - Don`t used
aye i had started picking apart the return from _KeyToStr() and doing much what your doing there (but not as clean) but i was sure there was an easer way to do it.
I'm still way too green to understand much of any of it, but it works pretty great.
but I noticed that 'backspace' and '-' don't register for me within the control. Another thing I was curious about was the approach to numlock. It looks like windows is still storing the state of numlock when it's pressed in the control. The light is correct on the keyboard itself, and it seems windows knows the state because if you hit numlock again it's on the correct mode, but it looks like it accidentally popped into the wrong mode.
I'm still way too green to understand much of any of it, but it works pretty great.
Thanks.
but I noticed that 'backspace' and '-' don't register for me within the control.
Single "Backspace" You can not assign a hot key, it is used to clear the input fields (like the "Esc"). "-" - this is an error in the _KeyToStr() function. Fixed.
Another thing I was curious about was the approach to numlock. It looks like windows is still storing the state of numlock when it's pressed in the control. The light is correct on the keyboard itself, and it seems windows knows the state because if you hit numlock again it's on the correct mode, but it looks like it accidentally popped into the wrong mode.
Indeed, a strange effect. It looks like in Windows you can not completely lock the "Num Lock". The only thing I can suggest at this point - use _KeyLock() to add "Num Lock" in the prohibited list of hot keys.