[osx] - fix sleep button for nyxboard - use the sleep button key code which will...
authorMemphiz <memphis@machzwo.de>
Wed, 16 Jan 2013 19:13:43 +0000 (20:13 +0100)
committerMemphiz <memphis@machzwo.de>
Wed, 16 Jan 2013 19:37:44 +0000 (20:37 +0100)
xbmc/main/osx/SDLMain.mm
xbmc/osx/HotKeyController.m

index 89f81b1..b53e7de 100644 (file)
@@ -417,7 +417,7 @@ static void setupWindowMenu(void)
   [pool release];
 }
 
-#define VK_SLEEP            0x5F
+#define VK_SLEEP            0x143
 #define VK_VOLUME_MUTE      0xAD
 #define VK_VOLUME_DOWN      0xAE
 #define VK_VOLUME_UP        0xAF
@@ -428,7 +428,7 @@ static void setupWindowMenu(void)
 #define VK_REWIND           0x9D
 #define VK_FAST_FWD         0x9E
 
-- (void)MediaKeyPower
+- (void)powerKeyNotification
 {
   SDL_Event event;
   memset(&event, 0, sizeof(event));
index e7e7a9f..b92c4ab 100644 (file)
@@ -294,7 +294,8 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
     m_active = NO;
     m_eventPort = NULL;
     m_runLoopSource = NULL;
-    m_controlSysPower = NO;
+    // power button controls xbmc sleep button (this will also trigger the osx shutdown menu - we can't prevent this as it seems)
+    m_controlSysPower = YES;
     m_controlSysVolume = YES; // volume keys control xbmc volume
   }
   return self;