[vlc-commits] macosx: added media key support for keyboards by other manufactorers than Apple such as Cherry

Felix Paul Kühne git at videolan.org
Wed Apr 11 21:53:42 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Apr 11 21:48:30 2012 +0200| [2baabf9dbe4217b61f6194ec3aaac411187cb635] | committer: Felix Paul Kühne

macosx: added media key support for keyboards by other manufactorers than Apple such as Cherry
(cherry picked from commit d082caf8f4f680bcfbcef9b6e86fafc1b16bca13)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=2baabf9dbe4217b61f6194ec3aaac411187cb635
---

 NEWS                               |    5 ++++-
 modules/gui/macosx/SPMediaKeyTap.m |    2 +-
 modules/gui/macosx/intf.m          |    4 ++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 1d4aced..599eae6 100644
--- a/NEWS
+++ b/NEWS
@@ -37,13 +37,16 @@ Mac OS X:
    the persistant media library
  * Enable import of playlist items taken from the service discovery modules
    to the media library or the temporary playlist
+ * Added media key support for keyboards by other manufacturers than Apple
+   This fix was facilitated through a hardware donation by ZF Friedrichshafen AG
+   manufacturing keyboards under the brand "Cherry".
  * Fullscreen fixes and video output improvements
  * Keep Aspect Ratio when resizing is back
  * Added controls to manipulate the Subtitles Duration to the Track 
    Synchronization panel
  * Hidden items in the sidebar are being retained for the next launch now
  * Fix crash when trying to open an Audio CD by drag & drop
- * Improve reliability when opening DVDs or BRs by drag & drop
+ * Improve reliability when opening DVDs or BDs by drag & drop
  * Fix crash on exit
  * Fix crash when mounting a device with multiple logical volumes while
    VLC is running
diff --git a/modules/gui/macosx/SPMediaKeyTap.m b/modules/gui/macosx/SPMediaKeyTap.m
index 4d3da8c..52a6650 100644
--- a/modules/gui/macosx/SPMediaKeyTap.m
+++ b/modules/gui/macosx/SPMediaKeyTap.m
@@ -183,7 +183,7 @@ static CGEventRef tapEventCallback2(CGEventTapProxy proxy, CGEventType type, CGE
         return event;
 
     int keyCode = (([nsEvent data1] & 0xFFFF0000) >> 16);
-    if (keyCode != NX_KEYTYPE_PLAY && keyCode != NX_KEYTYPE_FAST && keyCode != NX_KEYTYPE_REWIND)
+    if (keyCode != NX_KEYTYPE_PLAY && keyCode != NX_KEYTYPE_FAST && keyCode != NX_KEYTYPE_REWIND && keyCode != NX_KEYTYPE_PREVIOUS && keyCode != NX_KEYTYPE_NEXT)
         return event;
 
     if (![self shouldInterceptMediaKeyEvents])
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 2b4a812..2e3e859 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -823,7 +823,7 @@ static VLCMain *_o_sharedMainInstance = nil;
         if( keyCode == NX_KEYTYPE_PLAY && keyState == 0 )
             var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE );
 
-        if( keyCode == NX_KEYTYPE_FAST && !b_mediakeyJustJumped )
+        if( (keyCode == NX_KEYTYPE_FAST || keyCode == NX_KEYTYPE_NEXT) && !b_mediakeyJustJumped )
         {
             if( keyState == 0 && keyRepeat == 0 )
                 var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_NEXT );
@@ -837,7 +837,7 @@ static VLCMain *_o_sharedMainInstance = nil;
             }
         }
 
-        if( keyCode == NX_KEYTYPE_REWIND && !b_mediakeyJustJumped )
+        if( (keyCode == NX_KEYTYPE_REWIND || keyCode == NX_KEYTYPE_PREVIOUS) && !b_mediakeyJustJumped )
         {
             if( keyState == 0 && keyRepeat == 0 )
                 var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PREV );



More information about the vlc-commits mailing list