Recognise Left and Right Shift in KEY_EVENT_RECORD.dwControlKeyState #501

Open
opened 2026-01-30 21:53:50 +00:00 by claunia · 1 comment
Owner

Originally created by @alabuzhev on GitHub (Dec 30, 2018).

https://docs.microsoft.com/en-us/windows/console/key-event-record-str

wincon.h:

#define RIGHT_ALT_PRESSED     0x0001 // the right alt key is pressed.
#define LEFT_ALT_PRESSED      0x0002 // the left alt key is pressed.
#define RIGHT_CTRL_PRESSED    0x0004 // the right ctrl key is pressed.
#define LEFT_CTRL_PRESSED     0x0008 // the left ctrl key is pressed.
#define SHIFT_PRESSED         0x0010 // the shift key is pressed.
#define NUMLOCK_ON            0x0020 // the numlock light is on.
#define SCROLLLOCK_ON         0x0040 // the scrolllock light is on.
#define CAPSLOCK_ON           0x0080 // the capslock light is on.
#define ENHANCED_KEY          0x0100 // the key is enhanced.

Is it possible to extend it with:

#define LEFT_SHIFT_PRESSED    0x0200 // the left shift key is pressed.
#define RIGHT_SHIFT_PRESSED   0x0400 // the right shift key is pressed.

?

Motivation:

  • Symmetry and flexibility.

For compatibility reasons SHIFT_PRESSED (0x0010) should be preserved and set on either Shift key press of course.

Originally created by @alabuzhev on GitHub (Dec 30, 2018). https://docs.microsoft.com/en-us/windows/console/key-event-record-str wincon.h: ```C++ #define RIGHT_ALT_PRESSED 0x0001 // the right alt key is pressed. #define LEFT_ALT_PRESSED 0x0002 // the left alt key is pressed. #define RIGHT_CTRL_PRESSED 0x0004 // the right ctrl key is pressed. #define LEFT_CTRL_PRESSED 0x0008 // the left ctrl key is pressed. #define SHIFT_PRESSED 0x0010 // the shift key is pressed. #define NUMLOCK_ON 0x0020 // the numlock light is on. #define SCROLLLOCK_ON 0x0040 // the scrolllock light is on. #define CAPSLOCK_ON 0x0080 // the capslock light is on. #define ENHANCED_KEY 0x0100 // the key is enhanced. ``` Is it possible to extend it with: ```C++ #define LEFT_SHIFT_PRESSED 0x0200 // the left shift key is pressed. #define RIGHT_SHIFT_PRESSED 0x0400 // the right shift key is pressed. ``` ? Motivation: - Symmetry and flexibility. For compatibility reasons SHIFT_PRESSED (0x0010) should be preserved and set on either Shift key press of course.
claunia added the Issue-FeatureProduct-ConhostArea-Input labels 2026-01-30 21:53:51 +00:00
Author
Owner

@eugenesvk commented on GitHub (May 21, 2024):

What about the most important control key of all :)

  • ⊞ the Windows key itself?

Should also be part of the bitflags?

Also would be great to include other modifier keys used in advanced keybinding scenarios (since left vs right modifier support is very poor in general):

  • KANA
  • ROYA
  • LOYA

https://www.kbdedit.com/manual/low_level_modifiers.html#Roya_Loya

https://www.kbdedit.com/manual/ex13_replacing_altgr_with_kana.html

@eugenesvk commented on GitHub (May 21, 2024): What about the most important control key of all :) - ⊞ the Windows key itself? Should also be part of the bitflags? Also would be great to include other modifier keys used in advanced keybinding scenarios (since left vs right modifier support is very poor in general): - KANA - ROYA - LOYA https://www.kbdedit.com/manual/low_level_modifiers.html#Roya_Loya https://www.kbdedit.com/manual/ex13_replacing_altgr_with_kana.html
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#501