microsoft / microsoft/terminal

Recognise Left and Right Shift in KEY_EVENT_RECORD.dwControlKeyState

Open
#337 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Input Issue-Feature Product-Conhost
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the KEY_EVENT_RECORD.dwControlKeyState documentation and the wincon.h flag definitions quoted in the issue. Trace where these flags are produced and consumed in the Windows console input path, then identify compatibility requirements and tests needed to confirm that SHIFT_PRESSED remains set alongside the new left- and right-shift flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.