Issue with pause key events
bwRavencl opened this issue · 3 comments
There seems to be some strange difference between the keyboard events generated by ControllerBuddy and the Windows OSK concerning the Pause key.
Generally the Pause key seems to work just fine, however e.g. in DCS a combination of Right CTRL + Pause
is not handled correctly, although seems to get detected correctly by the DCS internal input mapper.
It seems this issue can be replicated with the following tool: https://w3c.github.io/uievents/tools/key-event-viewer.html
When pressing the Pause key via ControllerBuddy the tool detects an "unrecognized key".
Pressing the key via the Windows OSK the site shows "Pause".
The behaviour does not "improve" when the KEYEVENTF_EXTENDEDKEY
flag is not set.
Next up: compare with the events generated by a physical keyboard
// The USB keyboard driver translates NumLock to the scancode 0x45, but it // is delivered to applications as 0xE045. Meanwhile, Pause is translated // to the scancode sequence 0xE1 0x1D 0x45 0xE1 0x9D 0xC5, but is delivered // to applications as a plain 0x45. // // Injecting 0x45 using SendInput does get interpreted by Windows as // VK_NUMLOCK, but is not translated to 0xE045 before being delivered to // applications as it is with a physical keyboard. As a result, Chrome (for // example) reports a key value of "NumLock" but a code value of "Pause". // // Injecting 0xE045, on the otherhand, does not get interpreted as // VK_NUMLOCK, so Chrome sees reports a code value of "NumLock", but a key // value of "Unidentified". // // I have not been able to determine any way to use SendInput to inject an // event that Windows interprets as VK_PAUSE.