From 4c47dbe22c8afedbb3603e4acb23621277f5ef43 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Mon, 27 Nov 2023 01:04:10 -0500 Subject: [PATCH] input: add missing forward media key XF86Back and XF86Forward are mostly used to navigate file and web browsers to go back/forward in history. XF86Forward isn't recognized right now, so add it. Because XF86AudioForward already takes the "FORWARD" name, rename the browse keys to GO_BACK and GO_FORWARD instead. --- input/keycodes.c | 3 ++- input/keycodes.h | 9 +++++---- video/out/wayland_common.c | 3 ++- video/out/x11_common.c | 3 ++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/input/keycodes.c b/input/keycodes.c index bca9e17c14..c412191573 100644 --- a/input/keycodes.c +++ b/input/keycodes.c @@ -173,7 +173,8 @@ static const struct key_name key_names[] = { { MP_KEY_CHANNEL_DOWN,"CHANNEL_DOWN" }, { MP_KEY_PLAYONLY, "PLAYONLY" }, { MP_KEY_PAUSEONLY, "PAUSEONLY" }, - { MP_KEY_BACK, "BACK" }, + { MP_KEY_GO_BACK, "GO_BACK" }, + { MP_KEY_GO_FORWARD, "GO_FORWARD" }, { MP_KEY_TOOLS, "TOOLS" }, { MP_KEY_ZOOMIN, "ZOOMIN" }, { MP_KEY_ZOOMOUT, "ZOOMOUT" }, diff --git a/input/keycodes.h b/input/keycodes.h index a5a746aab7..1a21a3c89f 100644 --- a/input/keycodes.h +++ b/input/keycodes.h @@ -82,10 +82,11 @@ #define MP_KEY_CHANNEL_DOWN (MP_KEY_MM_BASE+22) #define MP_KEY_PLAYONLY (MP_KEY_MM_BASE+23) #define MP_KEY_PAUSEONLY (MP_KEY_MM_BASE+24) -#define MP_KEY_BACK (MP_KEY_MM_BASE+25) -#define MP_KEY_TOOLS (MP_KEY_MM_BASE+26) -#define MP_KEY_ZOOMIN (MP_KEY_MM_BASE+27) -#define MP_KEY_ZOOMOUT (MP_KEY_MM_BASE+28) +#define MP_KEY_GO_BACK (MP_KEY_MM_BASE+25) +#define MP_KEY_GO_FORWARD (MP_KEY_MM_BASE+26) +#define MP_KEY_TOOLS (MP_KEY_MM_BASE+27) +#define MP_KEY_ZOOMIN (MP_KEY_MM_BASE+28) +#define MP_KEY_ZOOMOUT (MP_KEY_MM_BASE+29) /* Function keys */ #define MP_KEY_F (MP_KEY_BASE+0x40) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 3aa535fc33..5c5b9b3706 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -133,7 +133,8 @@ static const struct mp_keymap keymap[] = { {XKB_KEY_XF86HomePage, MP_KEY_HOMEPAGE}, {XKB_KEY_XF86WWW, MP_KEY_WWW}, {XKB_KEY_XF86Mail, MP_KEY_MAIL}, {XKB_KEY_XF86Favorites, MP_KEY_FAVORITES}, {XKB_KEY_XF86Search, MP_KEY_SEARCH}, {XKB_KEY_XF86Sleep, MP_KEY_SLEEP}, - {XKB_KEY_XF86Back, MP_KEY_BACK}, {XKB_KEY_XF86Tools, MP_KEY_TOOLS}, + {XKB_KEY_XF86Back, MP_KEY_GO_BACK}, {XKB_KEY_XF86Forward, MP_KEY_GO_FORWARD}, + {XKB_KEY_XF86Tools, MP_KEY_TOOLS}, {XKB_KEY_XF86ZoomIn, MP_KEY_ZOOMIN}, {XKB_KEY_XF86ZoomOut, MP_KEY_ZOOMOUT}, {0, 0} diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 7b51791147..d006445cdb 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -754,7 +754,8 @@ static const struct mp_keymap keymap[] = { {XF86XK_HomePage, MP_KEY_HOMEPAGE}, {XF86XK_WWW, MP_KEY_WWW}, {XF86XK_Mail, MP_KEY_MAIL}, {XF86XK_Favorites, MP_KEY_FAVORITES}, {XF86XK_Search, MP_KEY_SEARCH}, {XF86XK_Sleep, MP_KEY_SLEEP}, - {XF86XK_Back, MP_KEY_BACK}, {XF86XK_Tools, MP_KEY_TOOLS}, + {XF86XK_Back, MP_KEY_GO_BACK}, {XF86XK_Forward, MP_KEY_GO_FORWARD}, + {XF86XK_Tools, MP_KEY_TOOLS}, {XF86XK_ZoomIn, MP_KEY_ZOOMIN}, {XF86XK_ZoomOut, MP_KEY_ZOOMOUT}, {0, 0}