|
Post by Robert on Dec 1, 2023 13:28:37 GMT -5
Stefan, your explanation is pretty much correct. Internally, basically all keyboards have the same physical keys (they are all manufactured basically the same), but when Windows does its physical I/O, it takes the physical key identifier and uses it to look up a Virtual Key code, by translating the physical key ID into a VK number which is contained in the device driver. When you use the English UK driver, the key under ESC gets mapped to VK_OEM_8, a key that SPFLite doesn't use. In Windows, any program that monitors the keyboard is ONLY passed VK codes. If that were not the case, it would be insane trying to write a program that could work on various physical layouts. MS had a very good reason for making VK codes.
Bottom line, if you want to type like the KEYMAP diagram shows, go buy yourself a US English ANSI keyboard. They are cheap.
R
|
|
|
Post by Stefan on Dec 2, 2023 4:47:55 GMT -5
Robert,
I found another Lenovo keyboard. This one is Model SK-8825 (L), same key layout as before, English (United Kingdom)
Interestingly, this one generates more KeyTest entries:
Enter any key, or press ESC twice to cancel VK SC HEX DEC C *ALT *CTRL CAPS NUM SCR *SHIFT ENH KEYNAME == == === === = ==== ===== ==== === === ====== === ======= DF 29 60 096 ` ---- ----- ---- --- --- ------ --- Unknown key DF 29 AC 172 ¬ ---- ----- ---- --- --- LSHIFT --- Unknown key DF 29 A6 166 ¦ RALT LCTRL ---- --- --- ------ --- Unknown key DF 29 00 000 ---- LCTRL ---- --- --- ------ --- Unknown key DF 29 60 096 ` LALT ----- ---- --- --- ------ --- Unknown key DF 29 A6 166 ¦ LALT LCTRL ---- --- --- ------ --- Unknown key DF 29 AC 172 ¬ LALT ----- ---- --- --- LSHIFT --- Unknown key DF 29 00 000 LALT LCTRL ---- --- --- LSHIFT --- Unknown key DF 29 00 000 ---- LCTRL ---- --- --- RSHIFT --- Unknown key
However, it still does so as VK_OEM_8, so still no help with SPFLite mapping.
Thanks for your explanations, I learned something new!
|
|
|
Post by Robert on Dec 2, 2023 10:21:55 GMT -5
I have been giving this some thought. I am not sure George is up for it, but I was thinking if KEYMAP had a way to enter "extra" keys, it might be possible to add to the "table" of known VK codes that were being intercepted. If we could do that, then users of non-US-ANSI keyboard could use what they had without buying some new one.
R
P.S. In my prior explanation, where I talked about the "physical key identifier", that is what the Scan Code is. In the KeyboardTest program, that's the SC column. Even though your VK is DF and mine is C0, we both have the same SC of 29, because this is physical key 29, no matter what.
|
|
|
Post by Jo on Dec 3, 2023 7:04:14 GMT -5
I have a Logitech-K200 Keyboard, german layout (qwertz) and the key below Esc is labeled '^'. As Robert posted earlier, I could remap it using the '\' key.
And yes, thanks for your explanations, I too learned something new !
|
|
|
Post by Robert on Dec 3, 2023 11:06:17 GMT -5
Right, because on German keyboards, the key under ESC is VK_OEM_5, which is the same virtual key as the \| above the Enter on a US keyboard, even though German keyboards map OEM_5 to ^ ° instead.
R
p.s. My keyboard knowledge was hard-won. I have been working on keyboard stuff since 2016. Some of it is pretty arcane.
|
|