Numpad "5" key generates different codes in Windows and GTK if NumLock is off (Issue #23478)

96 views
Skip to first unread message

unxed

unread,
Apr 22, 2023, 6:43:11 PM4/22/23
to wx-...@googlegroups.com, Subscribed

On Windows:

   Hook           CLEAR   305   ----    0 (U+0000)       12    0x004c0001  (  381,  698)  No
KeyDown           CLEAR   305   ----    0 (U+0000)       12    0x004c0001  (  381,  698)  No
   Char           CLEAR   305   ----    0 (U+0000)       12    0x004c0001  (  381,  698)  No
  KeyUp           CLEAR   305   ----    0 (U+0000)       12    0xc04c0001  (  382,  698)  Yes
  KeyUp          RETURN    13   ----   13 (U+000d)       13    0xc01c0001  (  957,  437)  Yes

On GTK:

   Hook    NUMPAD_BEGIN   383   ----    0 (U+0000)    65437    0x00000054  (  551,  374)  No
KeyDown    NUMPAD_BEGIN   383   ----    0 (U+0000)    65437    0x00000054  (  528,  358)  No
   Char            HOME   313   ----    0 (U+0000)    65437    0x00000054  (  528,  358)  No
  KeyUp    NUMPAD_BEGIN   383   ----    0 (U+0000)    65437    0x00000054  (  462,  306)  No


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478@github.com>

VZ

unread,
Apr 23, 2023, 9:25:50 AM4/23/23
to wx-...@googlegroups.com, Subscribed

Oops. I actually have no idea what should this key be called, I wouldn't expect neither "clear" not "begin" to be associated with it (the latter is pretty confusing as there is also WXK_NUMPAD_HOME). So perhaps the simplest fix would be to define some new WXK_NUMPAD_CENTER and generate it on both platforms and make both WXK_CLEAR and WXK_NUMPAD_BEGIN synonyms for it.

In 3.2 we could just add

#ifdef __WXMSW__
    WXK_NUMPAD_CENTER = WXK_CLEAR,
#else
    WXK_NUMPAD_CENTER = WXK_NUMPAD_BEGIN,
#endif

to wxKeyCode enum, which would be backwards compatible but would still allow
to use it in the new code.

If you'd like to make a PR doing this, please do, TIA!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1519067714@github.com>

VZ

unread,
Apr 23, 2023, 10:02:35 AM4/23/23
to wx-...@googlegroups.com, Subscribed

P.S. I wanted to test this also under Mac, but couldn't: the keyboard there doesn't have NumPad toggle so it can't be turned off (and the numpad keys don't have the alternative labels). And the virtual keyboard that can be shown there doesn't have numpad at all. If anybody does have a Mac keyboard with NumPad toggle, I'd be curious to know what does it call this key.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1519075114@github.com>

unxed

unread,
Apr 23, 2023, 10:27:42 AM4/23/23
to wx-...@googlegroups.com, Subscribed

Maybe test it using external USB PC keyboard?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1519080321@github.com>

Tobias Taschner

unread,
Apr 24, 2023, 7:41:17 AM4/24/23
to wx-...@googlegroups.com, Subscribed

As far as I'm aware all apple keyboards (that include a numpad) just have a "clear" key above the 7. And using num lock on a PC keyboard just does nothing.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1519985736@github.com>

unxed

unread,
Apr 24, 2023, 7:46:28 PM4/24/23
to wx-...@googlegroups.com, Subscribed

I'll just leave it here. Looks like there is no "common" keypad 5 meaning. So let it be numpad center, ok.

https://superuser.com/questions/1143071/has-the-5-key-on-the-numeric-keypad-ever-had-an-alternate-function-in-hardware


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1520957712@github.com>

unxed

unread,
Apr 24, 2023, 8:03:19 PM4/24/23
to wx-...@googlegroups.com, Subscribed

Done in #23491, please review.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1520971860@github.com>

unxed

unread,
Apr 24, 2023, 8:14:03 PM4/24/23
to wx-...@googlegroups.com, Subscribed

Hm, ScintillaWX and richtextctrl fails to build, could not figure out the reason for now


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1520981473@github.com>

unxed

unread,
Apr 24, 2023, 8:50:38 PM4/24/23
to wx-...@googlegroups.com, Subscribed

Fixed.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23478/1521008025@github.com>

VZ

unread,
May 8, 2023, 10:14:19 AM5/8/23
to wx-...@googlegroups.com, Subscribed

Closed #23478 as completed via 8a01942.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23478/issue_event/9190921162@github.com>

Reply all
Reply to author
Forward
0 new messages