[osx] - fix volume mediakeys now control xbmc volume (fixes volume buttons on nyxboar...
authorMemphiz <memphis@machzwo.de>
Tue, 15 Jan 2013 21:43:40 +0000 (22:43 +0100)
committerS. Davilla <davilla@4pi.com>
Fri, 18 Jan 2013 15:22:48 +0000 (10:22 -0500)
xbmc/osx/HotKeyController.m

index fa58af3..e7e7a9f 100644 (file)
@@ -178,7 +178,9 @@ static CGEventRef tapEventCallback2(CGEventTapProxy proxy, CGEventType type, CGE
   int keyState = (keyFlags & 0xFF00) >> 8;
   BOOL keyIsRepeat = (keyFlags & 0x1) > 0;
   
-  if (keyIsRepeat) 
+  // allow repeated keypresses for volume buttons
+  // all other repeated keypresses are handled by the os (is this really good?)
+  if (keyIsRepeat && keyCode != NX_KEYTYPE_SOUND_UP && keyCode != NX_KEYTYPE_SOUND_DOWN) 
     return event;
   
   NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
@@ -293,7 +295,7 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
     m_eventPort = NULL;
     m_runLoopSource = NULL;
     m_controlSysPower = NO;
-    m_controlSysVolume = NO;
+    m_controlSysVolume = YES; // volume keys control xbmc volume
   }
   return self;
 }