VAN0 Posted December 31, 2023 Share Posted December 31, 2023 (edited) Is there a way determine what actual key was pressed and not what value it represents? (also, if possible, restrict to GUI only, not entire system, don't want to end up with a keylogger) I've tried so far WH_KEYBOARD and WH_KEYBOARD_LL events and both return keys combination result, not actual keys. For example it returns the same code for End key and Shift + Num1 So, I guess I'm looking for some sort of "raw" keyboard input event? Thank you. P.S. I'm trying to create my own hotkey input field, because windows built-in msctls_hotkey32 type doesn't support Win key and other combinations which we can set with HotkeySet() Edited January 2 by VAN0 Link to comment Share on other sites More sharing options...
Nine Posted December 31, 2023 Share Posted December 31, 2023 Wrong forum ? Wrong key ? I suppose you mean Ins key and Shift + Num 0 give the same scan code and the same vkey, right ? But you can distinguish the two keys by using the Extended flag provided by WH_KEYBOARD... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
VAN0 Posted January 2 Author Share Posted January 2 (edited) Sorry, yes, wrong forum, and yes, Ins key (or in my case it was actually Num 1, so potato potato) Somehow in my tests I've missed that flag, only saw it being triggered in WH_KEYBOARD_LL, not in WH_KEYBOARD Now after more tests, I'm getting different results than the docs say. For example numpad keys don't trigger extended flag, but Ins, home, pgup, etc do... Also, interestingly, pressing Num nn while holding Shift triggers 2 events: keyup for the Num nn (correction: Shift) key and keydown for the whatever secondary equivalent of that key, like Ins Edited January 2 by VAN0 Link to comment Share on other sites More sharing options...
Nine Posted January 2 Share Posted January 2 Yes I got same results as you on extended flag and key up on shift. For the extended flag, it is true that docs is not exact, but the importance is that the flag allows to differentiate both set of keys. As for Shift down on num keys, it seems that keyboard forces a shift up. But vkey is not the same when shift is pressed and is not pressed, so again we got a way to differentiate keys. Overall, that makes management of the keyboard a bit tricky, but still consistent and doable. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now