Keyboard: Numpad Enter, a key that may be forgotten
There are two facts:
- In Microsoft's Virtual-Key Codes documentation, this key does not exist
- In Microsoft's DirectInput Keyboard Device Enumeration, there is a
DIK_NUMPADENTER
I used to think window messages couldn't differentiate between Enter and Numpad Enter, but:
- Press Enter key
- Press Enter key on numpad
This issue is also mentioned in the source code of Dear-ImGui (imgui_impl_win32).
Since my application was migrated from DirectInput to DirectXTK Keyboard, will the Numpad Enter key be officially supported in the future?
There many Undefined/Unassigned key codes in Virtual-Key Codes space, can we use them to store Numpad Enter?
Thanks for the report. I see that DirectInput had it's own enum that included DIK_NUMPADENTER, but there's no such virtual key defined (both return VK_RETURN).
I could emulate this with Win32, but I'll need to escalate this a bit since GameInput should also do this.
We are working to reserve 0x0E as VK_NUMPAD_RETURN to avoid any future conflicts.
| Constant | Value | Description |
|---|---|---|
| VK_RETURN | 0x0D | ENTER key |
| - | 0x0E-0F | Undefined |
| VK_SHIFT | 0x10 | SHIFT key |
Maybe a good option, close to VK_RETURN. 👍