Question

Is there a somehow portable way to understand if the key at left of "1" on the top raw of the keyboard has been pressed, by analyzing a wxKeyEvent?

For that key, in my keyboard both GetRawKeyCode() and GetKeyCode () return 126, which is 0x7E, and which seems to correspond to what I read here, but I don't know if it is portable to "any" (a good majority) of keyboards.

The rationale behind: my window react by pressing 0, 1, 2, 3, and I want that the key at the left of 1 gives the same behaviour of 0.

No correct solution

OTHER TIPS

There is no portable way to do it (of course, all keyboards may not even have a key to the left of "1"). And I don't think raw key code is a good way to identify this key even under Windows as it will be different if you use non-US keyboard layout. I'd probably use the bits 16-23 of the raw key flags which contain the scan code there. Raw key flags should also work with wxGTK as they contain the hardware_keycode there. I am not sure about OS X, the raw flags there are just the modifiers and I don't know if the key code is layout-independent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top