Bug 5229 - handle both shift keys on Windows
Summary: handle both shift keys on Windows
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VNC (show other bugs)
Version: trunk
Hardware: PC Windows
: P2 Normal
Target Milestone: 4.10.0
Assignee: Pierre Ossman
URL:
Keywords: ossman_tester, relnotes, upstream
Depends on: 7158
Blocks: 3523 7416
  Show dependency treegraph
 
Reported: 2014-08-22 11:54 CEST by Pierre Ossman
Modified: 2019-10-31 11:18 CET (History)
0 users

See Also:
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

Description Pierre Ossman cendio 2014-08-22 11:54:54 CEST
(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 Pierre Ossman cendio 2017-05-04 13:30:05 CEST
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 Pierre Ossman cendio 2018-08-27 13:55:44 CEST
Mostly fixed upstream:

https://github.com/TigerVNC/tigervnc/commit/30b3f926cbafe58e699a1e8893d96817ded21f3d
Comment 4 Pierre Ossman cendio 2018-09-28 10:48:05 CEST
> * 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.

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