From b9ee3d76684015e8096d2654dde1a03ad79d6890 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Wed, 24 Jun 2026 16:22:13 -0400 Subject: [PATCH] add non-VK Undo/Cut/Copy/Paste keycodes --- src/input.cpp | 8 +++++++- src/platform/linux/input/inputtino_keyboard.cpp | 7 ++++++- third-party/inputtino | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index db7618bfb05..0582d05563b 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -758,7 +758,13 @@ namespace input { } auto release = util::endian::little(packet->header.magic) == KEY_UP_EVENT_MAGIC; - auto keyCode = packet->keyCode & 0x00FF; + auto keyCode = util::endian::little(packet->keyCode); + + // Preserve full-width keycodes for Sunshine non-normalized keyboard events. + // Normalized keycodes are legacy VK values and only use the low 8 bits. + if (!(packet->flags & SS_KBE_FLAG_NON_NORMALIZED)) { + keyCode &= 0x00FF; + } // Set synthetic modifier flags if the keyboard packet is requesting modifier // keys that are not current pressed. diff --git a/src/platform/linux/input/inputtino_keyboard.cpp b/src/platform/linux/input/inputtino_keyboard.cpp index 72c456956a2..5aea3f528c1 100644 --- a/src/platform/linux/input/inputtino_keyboard.cpp +++ b/src/platform/linux/input/inputtino_keyboard.cpp @@ -157,7 +157,12 @@ namespace platf::keyboard { {KEY_BACKSLASH, 0xDC}, {KEY_RIGHTBRACE, 0xDD}, {KEY_APOSTROPHE, 0xDE}, - {KEY_102ND, 0xE2} + {KEY_102ND, 0xE2}, + // Sunshine extension keycodes (sent with SS_KBE_FLAG_NON_NORMALIZED) + {KEY_UNDO, 0x100}, + {KEY_CUT, 0x101}, + {KEY_COPY, 0x102}, + {KEY_PASTE, 0x103} }; void update(input_raw_t *raw, uint16_t modcode, bool release, uint8_t flags) { diff --git a/third-party/inputtino b/third-party/inputtino index b887f6a37a4..bcfdfdb3bf8 160000 --- a/third-party/inputtino +++ b/third-party/inputtino @@ -1 +1 @@ -Subproject commit b887f6a37a4f6babea66ee7b9a79bc8f520d7554 +Subproject commit bcfdfdb3bf88e94b6b239259bd156faeafb92813