Commit d082caf8 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added media key support for keyboards by other manufactorers than Apple such as Cherry

parent 8d9f4bb6
...@@ -183,7 +183,7 @@ static CGEventRef tapEventCallback2(CGEventTapProxy proxy, CGEventType type, CGE ...@@ -183,7 +183,7 @@ static CGEventRef tapEventCallback2(CGEventTapProxy proxy, CGEventType type, CGE
return event; return event;
int keyCode = (([nsEvent data1] & 0xFFFF0000) >> 16); 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; return event;
if (![self shouldInterceptMediaKeyEvents]) if (![self shouldInterceptMediaKeyEvents])
......
...@@ -824,7 +824,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -824,7 +824,7 @@ static VLCMain *_o_sharedMainInstance = nil;
if( keyCode == NX_KEYTYPE_PLAY && keyState == 0 ) if( keyCode == NX_KEYTYPE_PLAY && keyState == 0 )
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE ); 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 ) if( keyState == 0 && keyRepeat == 0 )
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_NEXT ); var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_NEXT );
...@@ -838,7 +838,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -838,7 +838,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 ) if( keyState == 0 && keyRepeat == 0 )
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PREV ); var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PREV );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment