www.cendio.com
Bug 5229 - handle both shift keys on Windows
: handle both shift keys on Windows
Status: CLOSED FIXED
: ThinLinc
VNC
: trunk
: PC Windows
: P2 Normal
: 4.10.0
Assigned To:
:
:
: 7158
: 3523
  Show dependency treegraph
 
Reported: 2014-08-22 11:54 by
Modified: 2018-09-28 10:48 (History)
Acceptance Criteria:
* Pressing right and left shift should send Shift_R and Shift_L respectively * Pressing both shift keys and releasing both should send release events for both (one release event gets delayed, platform limitation)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From cendio 2014-08-22 11:54:54
(from bug 4677)

Windows does not properly handle both shift keys. There are two main problems:

 a) Both keys send VK_SHIFT. This is similar to how both control keys send
VK_CONTROL. The difference is that the right control (and alt, etc.) key has
the extended bit set to tell it apart from the left. Both shift keys were
available on the original PC keyboard, so there is no extended bit for the
right one. The only way to tell them apart is to look at the scan code.

 b) Windows fails to keep track of state when both are pressed at the same
time. This sequence doesn't work:

    1. Press left shift
    2. Press right shift
    3. Release left shift
    4. Release right shift

    Step 3 never generates an event in this scenario, leaving the key
permanently pressed as far as VNC is concerned.
------- Comment #1 From cendio 2017-05-04 13:30:05 -------
Browsers seem to detect the right shift and send the proper Javascript event
for it. However they do indeed suffer from the mentioned bug that a release
gets lost and the state gets screwed up.
------- Comment #2 From cendio 2018-08-27 13:55:44 -------
Mostly fixed upstream:

https://github.com/TigerVNC/tigervnc/commit/30b3f926cbafe58e699a1e8893d96817ded21f3d
------- Comment #4 From cendio 2018-09-28 10:48:05 -------
> * Pressing right and left shift should send Shift_R and Shift_L respectively

Yup. Works well.

> * Pressing both shift keys and releasing one should send release events for both when on Windows (platform limitation)

Almost. It's when the last one is released you get the events. This is in line
with the initial description for this bug so the acceptance criteria needs to
be adjusted here.