From 134c3e148cbe2f21608e6d67431f23c3fcbbda8f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 1 Sep 2013 20:36:57 +0200 Subject: [PATCH] osx: use MP_KEY_* instead of MK_* for media keys In 213ad5d6c I added `MK_*` key bindings overlooking the fact that mpv already has `MP_KEY_*` for media keys. --- etc/input.conf | 5 ----- mpvcore/input/input.c | 4 ---- mpvcore/input/keycodes.h | 6 ------ osdep/macosx_events.m | 6 +++--- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/etc/input.conf b/etc/input.conf index 9c50ddad1a..04e9df1378 100644 --- a/etc/input.conf +++ b/etc/input.conf @@ -171,11 +171,6 @@ #AR_VDOWN add volume -1 #AR_VDOWN_HOLD add chapter -1 -# Media Keys section -#MK_PLAY cycle pause -#MK_PREV playlist_prev -#MK_NEXT playlist_next - # Joystick section # WARNING: joystick support has to be explicitly enabled at # compiletime with --enable-joystick diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index f977fd9e9d..41df0af855 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -429,10 +429,6 @@ static const struct key_name key_names[] = { { MP_AR_VDOWN, "AR_VDOWN" }, { MP_AR_VDOWN_HOLD, "AR_VDOWN_HOLD" }, - { MP_MK_PLAY, "MK_PLAY" }, - { MP_MK_PREV, "MK_PREV" }, - { MP_MK_NEXT, "MK_NEXT" }, - { MP_AXIS_UP, "AXIS_UP" }, { MP_AXIS_DOWN, "AXIS_DOWN" }, { MP_AXIS_LEFT, "AXIS_LEFT" }, diff --git a/mpvcore/input/keycodes.h b/mpvcore/input/keycodes.h index ade5091695..23aa634b5e 100644 --- a/mpvcore/input/keycodes.h +++ b/mpvcore/input/keycodes.h @@ -201,12 +201,6 @@ #define MP_AR_VDOWN (MP_AR_BASE + 12) #define MP_AR_VDOWN_HOLD (MP_AR_BASE + 13) -// Apple Media Keys input module -#define MP_MK_BASE (MP_KEY_BASE+0xF0) -#define MP_MK_PLAY (MP_MK_BASE + 0) -#define MP_MK_PREV (MP_MK_BASE + 1) -#define MP_MK_NEXT (MP_MK_BASE + 2) - // Mouse wheels or touchpad input #define MP_AXIS_BASE (MP_KEY_BASE+0x100) #define MP_AXIS_UP (MP_AXIS_BASE+0) diff --git a/osdep/macosx_events.m b/osdep/macosx_events.m index e09dc0af93..2edcba57ac 100644 --- a/osdep/macosx_events.m +++ b/osdep/macosx_events.m @@ -242,9 +242,9 @@ void cocoa_put_key_with_modifiers(int keycode, int modifiers) - (BOOL)handleMediaKey:(NSEvent *)event { NSDictionary *keymap = @{ - @(NX_KEYTYPE_PLAY): @(MP_MK_PLAY), - @(NX_KEYTYPE_REWIND): @(MP_MK_PREV), - @(NX_KEYTYPE_FAST): @(MP_MK_NEXT), + @(NX_KEYTYPE_PLAY): @(MP_KEY_PLAY), + @(NX_KEYTYPE_REWIND): @(MP_KEY_PREV), + @(NX_KEYTYPE_FAST): @(MP_KEY_NEXT), }; return [self handleKey:mk_code(event)