diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-11-06 17:31:11 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-06 17:33:14 +0100 |
commit | 42d0f5dd74fa0fe3bf3f26a92ecc5846db17895b (patch) | |
tree | 626cbb67dd589936bf77d34768e428231be30516 /vncviewer | |
parent | 0f1c63060cc000ddb8b15391b1349ab6653184ba (diff) | |
download | tigervnc-42d0f5dd74fa0fe3bf3f26a92ecc5846db17895b.tar.gz tigervnc-42d0f5dd74fa0fe3bf3f26a92ecc5846db17895b.zip |
Fixed handling of AltGr from Windows' touch keyboard
We need to test this always in order to catch Ctrl+AltGr, and to
handle release of the key properly. Hopefully there isn't any other
case where VK_MENU is sent without a scan code.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/Viewport.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 165560cb..18ed69e7 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -936,6 +936,13 @@ int Viewport::handleSystemEvent(void *event, void *data) keyCode = ((msg->lParam >> 16) & 0xff); + // Windows' touch keyboard doesn't set a scan code for the Alt + // portion of the AltGr sequence, so we need to help it out + if (!isExtended && (keyCode == 0x00) && (vKey == VK_MENU)) { + isExtended = true; + keyCode = 0x38; + } + // Windows doesn't have a proper AltGr, but handles it using fake // Ctrl+Alt. However the remote end might not be Windows, so we need // to merge those in to a single AltGr event. We detect this case @@ -945,13 +952,6 @@ int Viewport::handleSystemEvent(void *event, void *data) self->altGrArmed = false; Fl::remove_timeout(handleAltGrTimeout); - // Windows' touch keyboard doesn't set a scan code for the Alt - // portion of the AltGr sequence, so we need to help it out - if (!isExtended && (keyCode == 0x00)) { - isExtended = true; - keyCode = 0x38; - } - if (isExtended && (keyCode == 0x38) && (vKey == VK_MENU) && ((msg->time - self->altGrCtrlTime) < 50)) { // Alt seen, so this is an AltGr sequence @@ -1047,6 +1047,12 @@ int Viewport::handleSystemEvent(void *event, void *data) keyCode = ((msg->lParam >> 16) & 0xff); + // Touch keyboard AltGr (see above) + if (!isExtended && (keyCode == 0x00) && (vKey == VK_MENU)) { + isExtended = true; + keyCode = 0x38; + } + // We can't get a release in the middle of an AltGr sequence, so // abort that detection if (self->altGrArmed) { |