Add MODIFIER_EXTENDED flag to indicate extended keys

This commit is contained in:
Cameron Gutman
2026-09-26 14:50:13 -05:00
parent 5a2632990f
commit f900dd4767
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -941,6 +941,9 @@ int LiSendKeyboardEvent2(short keyCode, char keyAction, char modifiers, char fla
// No fixups // No fixups
break; break;
} }
// MODIFIER_EXTENDED is a Sunshine extension
modifiers &= ~MODIFIER_EXTENDED;
} }
holder->packet.keyboard.header.size = BE32(sizeof(NV_KEYBOARD_PACKET) - sizeof(uint32_t)); holder->packet.keyboard.header.size = BE32(sizeof(NV_KEYBOARD_PACKET) - sizeof(uint32_t));
+5
View File
@@ -694,12 +694,17 @@ int LiSendMouseButtonEvent(char action, int button);
// This function queues a keyboard event to be sent to the remote server. // This function queues a keyboard event to be sent to the remote server.
// Key codes are Win32 Virtual Key (VK) codes and interpreted as keys on // Key codes are Win32 Virtual Key (VK) codes and interpreted as keys on
// a US English layout. // a US English layout.
//
// MODIFIER_EXTENDED indicates an extended key (0xE0 scancode prefix).
// This is required to distinguish between certain keys like Enter
// and Numpad Enter that share the same VK code.
#define KEY_ACTION_DOWN 0x03 #define KEY_ACTION_DOWN 0x03
#define KEY_ACTION_UP 0x04 #define KEY_ACTION_UP 0x04
#define MODIFIER_SHIFT 0x01 #define MODIFIER_SHIFT 0x01
#define MODIFIER_CTRL 0x02 #define MODIFIER_CTRL 0x02
#define MODIFIER_ALT 0x04 #define MODIFIER_ALT 0x04
#define MODIFIER_META 0x08 #define MODIFIER_META 0x08
#define MODIFIER_EXTENDED 0x10
int LiSendKeyboardEvent(short keyCode, char keyAction, char modifiers); int LiSendKeyboardEvent(short keyCode, char keyAction, char modifiers);
// Similar to LiSendKeyboardEvent() but allows the client to inform the host that // Similar to LiSendKeyboardEvent() but allows the client to inform the host that