From a44940a4686bc6f11e8a425d779d3aeaf09ff9a7 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Thu, 24 Sep 2015 19:25:08 -0500 Subject: [PATCH] Flip the mapping of OA (Command) and Option keys. This matches the de facto standard of Mac VNC implementations, although it's inconsistent with the labeling of Option as "Alt." --- keyboard.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/keyboard.cc b/keyboard.cc index 3e3b0ce..da555ba 100644 --- a/keyboard.cc +++ b/keyboard.cc @@ -134,16 +134,18 @@ void SendModifiers (void) { if (modifiers == oldModifiers) return; - /* Apple key is sent as "meta" */ + /* Apple key is sent as "alt" */ + /* The opposite mapping of OA (Command) and Option might seem more logical, + * but this matches the de facto standard of Mac VNC implementations. */ if ((modifiers & appleKey) != (oldModifiers & appleKey)) - SendKeyEvent(modifiers & appleKey, 0xFFE7); + SendKeyEvent(modifiers & appleKey, 0xFFE9); if ((modifiers & shiftKey) != (oldModifiers & shiftKey)) SendKeyEvent(modifiers & shiftKey, 0xFFE1); - /* Option key is sent as "alt," as per its labelling on some keyboards */ + /* Option key is sent as "meta" */ if ((modifiers & optionKey) != (oldModifiers & optionKey)) - SendKeyEvent(modifiers & optionKey, 0xFFE9); + SendKeyEvent(modifiers & optionKey, 0xFFE7); if ((modifiers & controlKey) != (oldModifiers & controlKey)) SendKeyEvent(modifiers & controlKey, 0xFFE3);