rename Command key to OSKey, Window manager already called it the OSKey but internall...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 5 Oct 2010 19:10:15 +0000 (19:10 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 5 Oct 2010 19:10:15 +0000 (19:10 +0000)
15 files changed:
intern/ghost/GHOST_Types.h
intern/ghost/intern/GHOST_EventPrinter.cpp
intern/ghost/intern/GHOST_ModifierKeys.cpp
intern/ghost/intern/GHOST_ModifierKeys.h
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/test/multitest/EventToBuf.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_text/text_python.c
source/blender/editors/transform/transform.c
source/blender/makesrna/intern/rna_wm.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_window.c
source/blender/windowmanager/wm_event_types.h

index f926e72119f38f0ba768e0c4564a19ba87619426..20b69611bfb307600e24166613ad6b2e8c4b5003 100644 (file)
@@ -96,7 +96,7 @@ typedef enum {
     GHOST_kModifierKeyRightAlt,
     GHOST_kModifierKeyLeftControl,
     GHOST_kModifierKeyRightControl,
-    GHOST_kModifierKeyCommand,         // APPLE only
+    GHOST_kModifierKeyOS,
     GHOST_kModifierKeyNumMasks
 } GHOST_TModifierKeyMask;
 
@@ -283,7 +283,7 @@ typedef enum {
        GHOST_kKeyRightControl,
        GHOST_kKeyLeftAlt,
        GHOST_kKeyRightAlt,
-       GHOST_kKeyCommand,              // Command key on Apple, Windows key(s) on Windows
+       GHOST_kKeyOS,           // Command key on Apple, Windows key(s) on Windows
        GHOST_kKeyGrLess ,              // German PC only!
 
        GHOST_kKeyCapsLock,
index 645a33ab8c57609c64c3be94e99e0cdb0aa28339..697ced64a70bde0e8cc3d2f3d2c59d8fad6c687f 100644 (file)
@@ -255,9 +255,8 @@ void GHOST_EventPrinter::getKeyString(GHOST_TKey key, STR_String& str) const
                case GHOST_kKeyRightAlt:
                        str = "RightAlt";
                        break;
-               case GHOST_kKeyCommand:
-            // APPLE only!
-                       str = "Command";
+               case GHOST_kKeyOS:
+                       str = "OS";
                        break;
                case GHOST_kKeyGrLess:
             // PC german!
index ed884966cb3d5663ad673a7970b84fd26ff28d08..361329532f965abe557c338437abc9bdcaf6a53e 100644 (file)
@@ -55,7 +55,7 @@ GHOST_TKey GHOST_ModifierKeys::getModifierKeyCode(GHOST_TModifierKeyMask mask)
        case GHOST_kModifierKeyRightAlt:                key = GHOST_kKeyRightAlt;               break;
        case GHOST_kModifierKeyLeftControl:             key = GHOST_kKeyLeftControl;    break;
        case GHOST_kModifierKeyRightControl:    key = GHOST_kKeyRightControl;   break;
-       case GHOST_kModifierKeyCommand:                 key = GHOST_kKeyCommand;                break;
+       case GHOST_kModifierKeyOS:                      key = GHOST_kKeyOS;             break;
        default:
                // Should not happen
                key = GHOST_kKeyUnknown;
@@ -80,8 +80,8 @@ bool GHOST_ModifierKeys::get(GHOST_TModifierKeyMask mask) const
         return m_LeftControl;
     case GHOST_kModifierKeyRightControl:
         return m_RightControl;
-    case GHOST_kModifierKeyCommand:
-        return m_Command;
+    case GHOST_kModifierKeyOS:
+        return m_OS;
     default:
         return false;
     }
@@ -103,8 +103,8 @@ void GHOST_ModifierKeys::set(GHOST_TModifierKeyMask mask, bool down)
         m_LeftControl = down; break;
     case GHOST_kModifierKeyRightControl:
         m_RightControl = down; break;
-    case GHOST_kModifierKeyCommand:
-        m_Command = down; break;
+    case GHOST_kModifierKeyOS:
+        m_OS = down; break;
     default:
         break;
     }
@@ -119,7 +119,7 @@ void GHOST_ModifierKeys::clear()
     m_RightAlt = false;
     m_LeftControl = false;
     m_RightControl = false;
-    m_Command = false;
+    m_OS = false;
 }
 
 
@@ -131,5 +131,5 @@ bool GHOST_ModifierKeys::equals(const GHOST_ModifierKeys& keys) const
                (m_RightAlt == keys.m_RightAlt) &&
                (m_LeftControl == keys.m_LeftControl) &&
                (m_RightControl == keys.m_RightControl) &&
-        (m_Command == keys.m_Command);
+        (m_OS == keys.m_OS);
 }
index e18899bc939b3804808cc170c9079fa7fa7f0fbe..77d6d5757d930ea61de6fb85ea820781458ec62c 100644 (file)
@@ -96,8 +96,8 @@ struct GHOST_ModifierKeys
     GHOST_TUns8 m_LeftControl : 1;
     /** Bitfield that stores the appropriate key state. */
     GHOST_TUns8 m_RightControl : 1;
-    /** Bitfield that stores the appropriate key state. APPLE only! */
-    GHOST_TUns8 m_Command : 1;
+    /** Bitfield that stores the appropriate key state. */
+    GHOST_TUns8 m_OS : 1;
 };
 
 #endif // _GHOST_MODIFIER_KEYS_H_
index ecdc03b43479f0bb8bb9ec4e26f32d0c7e6afdd3..75cbe5db574c942f28e8348e7ae2fe7998fb80d1 100644 (file)
@@ -553,7 +553,7 @@ GHOST_TSuccess GHOST_SystemCarbon::getModifierKeys(GHOST_ModifierKeys& keys) con
 {
     UInt32 modifiers = ::GetCurrentKeyModifiers();
 
-    keys.set(GHOST_kModifierKeyCommand, (modifiers & cmdKey) ? true : false);
+    keys.set(GHOST_kModifierKeyOS, (modifiers & cmdKey) ? true : false);
     keys.set(GHOST_kModifierKeyLeftAlt, (modifiers & optionKey) ? true : false);
     keys.set(GHOST_kModifierKeyLeftShift, (modifiers & shiftKey) ? true : false);
     keys.set(GHOST_kModifierKeyLeftControl, (modifiers & controlKey) ? true : false);
@@ -941,7 +941,7 @@ OSStatus GHOST_SystemCarbon::handleKeyEvent(EventRef event)
                                pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & optionKey)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyLeftAlt) );
                        }
                        if ((modifiers & cmdKey) != (m_modifierMask & cmdKey)) {
-                               pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & cmdKey)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyCommand) );
+                               pushEvent( new GHOST_EventKey(getMilliSeconds(), (modifiers & cmdKey)?GHOST_kEventKeyDown:GHOST_kEventKeyUp, window, GHOST_kKeyOS) );
                        }
                        
                        m_modifierMask = modifiers;
index dceecb53dd2e69aad02d7d53aabf3c3c007441bb..6255995319564b56b572e420434f17a7a07551e0 100644 (file)
@@ -303,9 +303,9 @@ GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) cons
                bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0;
                bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0;
                if(lwindown || rwindown)
-                       keys.set(GHOST_kModifierKeyCommand, true);
+                       keys.set(GHOST_kModifierKeyOS, true);
                else
-                       keys.set(GHOST_kModifierKeyCommand, false);
+                       keys.set(GHOST_kModifierKeyOS, false);
        }
        else {
                bool down = HIBYTE(::GetKeyState(VK_SHIFT)) != 0;
@@ -320,9 +320,9 @@ GHOST_TSuccess GHOST_SystemWin32::getModifierKeys(GHOST_ModifierKeys& keys) cons
                bool lwindown = HIBYTE(::GetKeyState(VK_LWIN)) != 0;
                bool rwindown = HIBYTE(::GetKeyState(VK_RWIN)) != 0;
                if(lwindown || rwindown)
-                       keys.set(GHOST_kModifierKeyCommand, true);
+                       keys.set(GHOST_kModifierKeyOS, true);
                else
-                       keys.set(GHOST_kModifierKeyCommand, false);
+                       keys.set(GHOST_kModifierKeyOS, false);
        }
        return GHOST_kSuccess;
 }
index b07dba7319fe0c3707660b8af7d5ce05d504769c..393761566baf01110b0d652bf6f48bd9b95f18f5 100644 (file)
@@ -891,13 +891,13 @@ getModifierKeys(
                keys.set(GHOST_kModifierKeyRightAlt,false);
        }
 
-       // Super (Windows) - only one GHOST-kModifierKeyCommand, so mapping
+       // Super (Windows) - only one GHOST-kModifierKeyOS, so mapping
        // to either
        if ( ((m_keyboard_vector[super_l >> 3] >> (super_l & 7)) & 1) || 
             ((m_keyboard_vector[super_r >> 3] >> (super_r & 7)) & 1) ) {
-               keys.set(GHOST_kModifierKeyCommand,true);
+               keys.set(GHOST_kModifierKeyOS,true);
        } else {
-               keys.set(GHOST_kModifierKeyCommand,false);
+               keys.set(GHOST_kModifierKeyOS,false);
        }
        return GHOST_kSuccess;
 }
@@ -1106,8 +1106,8 @@ convertXKey(
                        GXMAP(type,XK_Control_R,        GHOST_kKeyRightControl);
                        GXMAP(type,XK_Alt_L,            GHOST_kKeyLeftAlt);
                        GXMAP(type,XK_Alt_R,            GHOST_kKeyRightAlt);
-                       GXMAP(type,XK_Super_L,          GHOST_kKeyCommand);
-                       GXMAP(type,XK_Super_R,          GHOST_kKeyCommand);
+                       GXMAP(type,XK_Super_L,          GHOST_kKeyOS);
+                       GXMAP(type,XK_Super_R,          GHOST_kKeyOS);
 
                        GXMAP(type,XK_Insert,           GHOST_kKeyInsert);
                        GXMAP(type,XK_Delete,           GHOST_kKeyDelete);
index 1dbaad35994b4d618d5a0c04e1202d2cad2d5410..859600bb78323a080886c2710ab5b58e87a41b8e 100644 (file)
@@ -125,7 +125,7 @@ static char *keytype_to_string(GHOST_TKey key) {
        K(KeyRightControl);
        K(KeyLeftAlt);
        K(KeyRightAlt);
-       K(KeyCommand);
+       K(KeyOS);
 
        K(KeyCapsLock);
        K(KeyNumLock);
index b876aa11ab539f7e64357693d170800df5154ed1..c9aac8502c455f72a6c1be759956083fb93f7fa1 100644 (file)
@@ -5545,7 +5545,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo
                                uiDefButS(block, OPTION, 0, "Shift",    xstart, (int)te->ys+1, butw3+5, OL_H-1, &kmi->shift, 0, 0, 0, 0, "Modifier"); xstart+= butw3+5;
                                uiDefButS(block, OPTION, 0, "Ctrl",     xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->ctrl, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
                                uiDefButS(block, OPTION, 0, "Alt",      xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->alt, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
-                               uiDefButS(block, OPTION, 0, "Cmd",      xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->oskey, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
+                               uiDefButS(block, OPTION, 0, "OS",       xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->oskey, 0, 0, 0, 0, "Modifier"); xstart+= butw3;
                                xstart+= 5;
                                uiDefKeyevtButS(block, 0, "", xstart, (int)te->ys+1, butw3, OL_H-1, &kmi->keymodifier, "Key Modifier code");
                                xstart+= butw3+5;
index aee1a7ecfd6316c942ca0da02e7c8422705bba88..9be554924c9424bcd51ced2a01d72557b1d3e910 100644 (file)
@@ -182,7 +182,7 @@ static void confirm_suggestion(Text *text, int skipleft)
 #define LR_SHIFTKEY 0
 #define LR_ALTKEY 0
 #define LR_CTRLKEY 0
-#define LR_COMMANDKEY 0
+#define LR_OSKEY 0
 
 // XXX
 static int doc_scroll= 0;
index a6fcfb0498206074eaa045cb65ff94b9eb676c67..1778e648e20ca608b3ba6264a16529e50faae096 100644 (file)
@@ -1534,7 +1534,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
                                if ((ELEM(kmi->type, LEFTCTRLKEY, RIGHTCTRLKEY) && event->ctrl) ||
                                        (ELEM(kmi->type, LEFTSHIFTKEY, RIGHTSHIFTKEY) && event->shift) ||
                                        (ELEM(kmi->type, LEFTALTKEY, RIGHTALTKEY) && event->alt) ||
-                                       (kmi->type == COMMANDKEY && event->oskey)) {
+                                       (kmi->type == OSKEY && event->oskey)) {
                                        t->modifiers |= MOD_SNAP_INVERT;
                                }
                                break;
index 62d0c99f6c58ca5c22efeee2b546a335b1c210bd..7e54a3b14fa9ad3fe195e67fa7e910e30bcc181d 100644 (file)
@@ -175,7 +175,7 @@ EnumPropertyItem event_type_items[] = {
        {RIGHTCTRLKEY,  "RIGHT_CTRL",   0, "Right Ctrl", ""},
        {RIGHTSHIFTKEY, "RIGHT_SHIFT",  0, "Right Shift", ""},
        {0, "", 0, NULL, NULL},
-       {COMMANDKEY,    "COMMAND",      0, "Command", ""},
+       {OSKEY, "OSKEY",        0, "OS Key", ""},
        {0, "", 0, NULL, NULL},
        {ESCKEY, "ESC", 0, "Esc", ""},
        {TABKEY, "TAB", 0, "Tab", ""},
index 590d28012f9d9305cf21ccca8b3ff8f97ddbb028..334bc79b96afdb4e8a043a41d33a927422bfedf2 100644 (file)
@@ -2067,7 +2067,7 @@ static int convert_key(GHOST_TKey key)
                        case GHOST_kKeyRightShift:              return RIGHTSHIFTKEY;
                        case GHOST_kKeyLeftControl:             return LEFTCTRLKEY;
                        case GHOST_kKeyRightControl:    return RIGHTCTRLKEY;
-                       case GHOST_kKeyCommand:                 return COMMANDKEY;
+                       case GHOST_kKeyOS:                              return OSKEY;
                        case GHOST_kKeyLeftAlt:                 return LEFTALTKEY;
                        case GHOST_kKeyRightAlt:                return RIGHTALTKEY;
                                
@@ -2324,7 +2324,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int t
                                if(event.val==KM_PRESS && (evt->ctrl || evt->shift || evt->oskey))
                                   event.alt= evt->alt = 3;             // define?
                        } 
-                       else if (event.type==COMMANDKEY) {
+                       else if (event.type==OSKEY) {
                                event.oskey= evt->oskey= (event.val==KM_PRESS);
                                if(event.val==KM_PRESS && (evt->ctrl || evt->alt || evt->shift))
                                   event.oskey= evt->oskey = 3;         // define?
index 328c3e80259c37bf629aa2479448ac51f5db08f7..d9d7abd3a681aa7fa18d74ea9a0205a1ba124c65 100644 (file)
@@ -528,7 +528,7 @@ static int query_qual(char qual)
                left= GHOST_kModifierKeyLeftControl;
                right= GHOST_kModifierKeyRightControl;
        } else if (qual=='C') {
-               left= right= GHOST_kModifierKeyCommand;
+               left= right= GHOST_kModifierKeyOS;
        } else {
                left= GHOST_kModifierKeyLeftAlt;
                right= GHOST_kModifierKeyRightAlt;
@@ -613,7 +613,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
                                        wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
                                }
                                if (win->eventstate->oskey && !query_qual('C')) {
-                                       kdata.key= GHOST_kKeyCommand;
+                                       kdata.key= GHOST_kKeyOS;
                                        wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
                                }
                                /* keymodifier zero, it hangs on hotkeys that open windows otherwise */
index e4b56080b0370945fb21a68fe0a335732917824c..efc31f6f7c389d244cca06d28a987f5691fc0ff0 100644 (file)
 #define        ENDKEY          170
 
 #define UNKNOWNKEY     171
-#define COMMANDKEY     172
+#define OSKEY          172
 #define GRLESSKEY      173
 
 /* for event checks */
 #define ISKEYBOARD(event)      (event >=' ' && event <=320)
 
        /* test whether the event is a modifier key */
-#define ISKEYMODIFIER(event)   ((event >= LEFTCTRLKEY && event <= LEFTSHIFTKEY) || event == COMMANDKEY)
+#define ISKEYMODIFIER(event)   ((event >= LEFTCTRLKEY && event <= LEFTSHIFTKEY) || event == OSKEY)
 
        /* test whether the event is a mouse button */
 #define ISMOUSE(event) (event >= LEFTMOUSE && event <= MOUSEROTATE)