diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-02-25 15:32:24 +0100 |
---|---|---|
committer | Linn Mattsson <linma@cendio.se> | 2024-10-18 11:03:47 +0200 |
commit | 0db0c3d94f0822b9d3b2e84756455f844cfae002 (patch) | |
tree | 6c9798d665b54fb76b77cd64347629a2e457caa5 | |
parent | 4b859cae706af8e59671f8105be17a4436d7ba34 (diff) | |
download | tigervnc-0db0c3d94f0822b9d3b2e84756455f844cfae002.tar.gz tigervnc-0db0c3d94f0822b9d3b2e84756455f844cfae002.zip |
Include key code for fake key events
Let's try to mimic a real event as much as possible to avoid bugs.
(cherry picked from commit 6111c0587aec6ea4700a91a460c7027572ab5011)
-rw-r--r-- | common/rfb/VNCSConnectionST.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/rfb/VNCSConnectionST.cxx b/common/rfb/VNCSConnectionST.cxx index 75874495..50a968d1 100644 --- a/common/rfb/VNCSConnectionST.cxx +++ b/common/rfb/VNCSConnectionST.cxx @@ -496,12 +496,12 @@ public: ~VNCSConnectionSTShiftPresser() { if (pressed) { vlog.debug("Releasing fake Shift_L"); - server->keyEvent(XK_Shift_L, 0, false); + server->keyEvent(XK_Shift_L, 0x2a, false); } } void press() { vlog.debug("Pressing fake Shift_L"); - server->keyEvent(XK_Shift_L, 0, true); + server->keyEvent(XK_Shift_L, 0x2a, true); pressed = true; } VNCServerST* server; @@ -550,8 +550,8 @@ void VNCSConnectionST::keyEvent(uint32_t keysym, uint32_t keycode, bool down) { if (lock == (uppercase == shift)) { vlog.debug("Inserting fake CapsLock to get in sync with client"); - server->keyEvent(XK_Caps_Lock, 0, true); - server->keyEvent(XK_Caps_Lock, 0, false); + server->keyEvent(XK_Caps_Lock, 0x3a, true); + server->keyEvent(XK_Caps_Lock, 0x3a, false); } } @@ -580,8 +580,8 @@ void VNCSConnectionST::keyEvent(uint32_t keysym, uint32_t keycode, bool down) { // } else if (lock == (number == shift)) { vlog.debug("Inserting fake NumLock to get in sync with client"); - server->keyEvent(XK_Num_Lock, 0, true); - server->keyEvent(XK_Num_Lock, 0, false); + server->keyEvent(XK_Num_Lock, 0x45, true); + server->keyEvent(XK_Num_Lock, 0x45, false); } } } |