Patchwork XF86 forward/rewind

login
register
mail settings
Submitter Rafi Rubin
Date April 18, 2012, 1:45 p.m.
Message ID <4F8EC58C.7070800@ugcs.caltech.edu>
Download mbox | patch
Permalink /patch/20543/
State New
Headers show

Comments

Rafi Rubin - April 18, 2012, 1:45 p.m.
Hi, here's a little patch to add support for xf86 forward and rewind keys.
These are sent by my remote when I hold down the next/prev buttons for
continuous skip/seek.

Rafi
Nicolas George - April 23, 2012, 10:34 a.m.
Le decadi 30 germinal, an CCXX, Rafi Rubin a écrit :
> Hi, here's a little patch to add support for xf86 forward and rewind keys.
> These are sent by my remote when I hold down the next/prev buttons for
> continuous skip/seek.

Thanks for the patch.

> 
> Rafi

> diff --git a/input/input.c b/input/input.c
> index d8f094e..9c2eb61 100644
> --- a/input/input.c
> +++ b/input/input.c
> @@ -367,6 +367,8 @@ static const mp_key_name_t key_names[] = {
>    { KEY_STOP, "XF86_STOP" },
>    { KEY_PREV, "XF86_PREV" },
>    { KEY_NEXT, "XF86_NEXT" },
> +  { KEY_PREV, "XF86_REWIND" },
> +  { KEY_NEXT, "XF86_FORWARD" },

Two different names for the same key symbol do not seem like a good idea: if
someone actually has both XF86XK_AudioPrev and XF86XK_AudioRewind, they can
not map them both. I believe it would be a better idea to define new symbols
KEY_REWIND and KEY_FORWARD in osdep/keycodes.h.

>  
>    { KEY_CLOSE_WIN, "CLOSE_WIN" },
>  
> diff --git a/libvo/x11_common.c b/libvo/x11_common.c
> index 51c3669..318ef0e 100644
> --- a/libvo/x11_common.c
> +++ b/libvo/x11_common.c
> @@ -560,6 +560,8 @@ static const struct mp_keymap keysym_map[] = {
>      {XF86XK_AudioPlay, KEY_PLAY}, {XF86XK_AudioPause, KEY_PAUSE}, {XF86XK_AudioStop, KEY_STOP},
>      {XF86XK_AudioPrev, KEY_PREV}, {XF86XK_AudioNext, KEY_NEXT},
>      {XF86XK_AudioMute, KEY_MUTE}, {XF86XK_AudioLowerVolume, KEY_VOLUME_DOWN}, {XF86XK_AudioRaiseVolume, KEY_VOLUME_UP},
> +    {XF86XK_AudioRewind, KEY_REWIND}, {XF86XK_AudioForward, KEY_FORWARD},
> +    {XF86XK_AudioMute, KEY_MUTE}, {XF86XK_AudioLowerVolume, KEY_VOLUME_DOWN}, {XF86XK_AudioRaiseVolume, KEY_VOLUME_UP},

It looks like you made some kind of copy-paste mistake there.

>  #endif
>      {0, 0}
>  };

Regards,

Patch

diff --git a/input/input.c b/input/input.c
index d8f094e..9c2eb61 100644
--- a/input/input.c
+++ b/input/input.c
@@ -367,6 +367,8 @@  static const mp_key_name_t key_names[] = {
   { KEY_STOP, "XF86_STOP" },
   { KEY_PREV, "XF86_PREV" },
   { KEY_NEXT, "XF86_NEXT" },
+  { KEY_PREV, "XF86_REWIND" },
+  { KEY_NEXT, "XF86_FORWARD" },
 
   { KEY_CLOSE_WIN, "CLOSE_WIN" },
 
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 51c3669..318ef0e 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -560,6 +560,8 @@  static const struct mp_keymap keysym_map[] = {
     {XF86XK_AudioPlay, KEY_PLAY}, {XF86XK_AudioPause, KEY_PAUSE}, {XF86XK_AudioStop, KEY_STOP},
     {XF86XK_AudioPrev, KEY_PREV}, {XF86XK_AudioNext, KEY_NEXT},
     {XF86XK_AudioMute, KEY_MUTE}, {XF86XK_AudioLowerVolume, KEY_VOLUME_DOWN}, {XF86XK_AudioRaiseVolume, KEY_VOLUME_UP},
+    {XF86XK_AudioRewind, KEY_REWIND}, {XF86XK_AudioForward, KEY_FORWARD},
+    {XF86XK_AudioMute, KEY_MUTE}, {XF86XK_AudioLowerVolume, KEY_VOLUME_DOWN}, {XF86XK_AudioRaiseVolume, KEY_VOLUME_UP},
 #endif
     {0, 0}
 };