]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/hid.cpp
Set the menu itself as event object for EVT_MENU_{OPEN,CLOSED} in wxMSW.
[wxWidgets.git] / src / osx / core / hid.cpp
index 2a35960274f03bd520af963fa964bfb8ae95a590..d9ebf8b2fec4ba82c2a345490aee60a62eecd452 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/osx/corefoundation/hid.cpp
+// Name:        src/osx/core/hid.cpp
 // Purpose:     DARWIN HID layer for WX Implementation
 // Author:      Ryan Norton
 // Modified by:
@@ -24,8 +24,7 @@
     #pragma hdrstop
 #endif
 
-//DARWIN _ONLY_
-#ifdef __DARWIN__
+#if wxOSX_USE_COCOA_OR_CARBON
 
 #include "wx/osx/core/hid.h"
 
@@ -422,7 +421,7 @@ enum
     WXK_RSHIFT = 400,
     WXK_RALT,
     WXK_RCONTROL,
-    WXK_RMENU
+    WXK_RAW_RCONTROL,
 };
 
 // ----------------------------------------------------------------------------
@@ -478,8 +477,8 @@ void wxHIDKeyboard::BuildCookies(CFArrayRef Array)
 void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array)
 {
     //Now go through each possible cookie
-    int i,
-        nUsage;
+    int i;
+    long nUsage;
 //    bool bEOTriggered = false;
     for (i = 0; i < CFArrayGetCount(Array); ++i)
     {
@@ -602,7 +601,7 @@ void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array)
 
             //Menu keys, Shift, other specials
             case kHIDUsage_KeyboardLeftControl:
-                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_CONTROL);
+                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RAW_CONTROL);
                 break;
             case kHIDUsage_KeyboardLeftShift:
                 AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_SHIFT);
@@ -611,10 +610,10 @@ void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array)
                 AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_ALT);
                 break;
             case kHIDUsage_KeyboardLeftGUI:
-                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_MENU);
+                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_CONTROL);
                 break;
             case kHIDUsage_KeyboardRightControl:
-                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RCONTROL);
+                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RAW_RCONTROL);
                 break;
             case kHIDUsage_KeyboardRightShift:
                 AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RSHIFT);
@@ -623,7 +622,7 @@ void wxHIDKeyboard::DoBuildCookies(CFArrayRef Array)
                 AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RALT);
                 break;
             case kHIDUsage_KeyboardRightGUI:
-                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RMENU);
+                AddCookie(CFArrayGetValueAtIndex(Array, i),WXK_RCONTROL);
                 break;
 
             //Default
@@ -655,7 +654,7 @@ class wxHIDModule : public wxModule
         {
             for(size_t i = 0; i < sm_keyboards.GetCount(); ++i)
                 delete (wxHIDKeyboard*) sm_keyboards[i];
-               sm_keyboards.Clear(); 
+            sm_keyboards.Clear();
         }
 };
 
@@ -724,9 +723,9 @@ bool wxGetKeyState (wxKeyCode key)
                 return true;
             }
         break;
-    case WXK_MENU:
-            if( keyboard->IsActive(WXK_MENU) ||
-                   keyboard->IsActive(WXK_RMENU) )
+    case WXK_RAW_CONTROL:
+            if( keyboard->IsActive(WXK_RAW_CONTROL) ||
+                   keyboard->IsActive(WXK_RAW_RCONTROL) )
             {
                 return true;
             }