mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 13:32:16 +00:00
input: add missing keypad key defines
So far all the keypad keys except for `0` and `,` mapped to the same MP_KEY_* independent of numlock state, even though different key codes are received. Now all the alternative functions map to appropriate MP_KEY_* defines, with missing ones added.
This commit is contained in:
parent
c0fb9b4b83
commit
0c9d8619e8
@ -89,6 +89,14 @@ static const struct key_name key_names[] = {
|
||||
{ MP_KEY_KPDEL, "KP_DEL" },
|
||||
{ MP_KEY_KPDEC, "KP_DEC" },
|
||||
{ MP_KEY_KPINS, "KP_INS" },
|
||||
{ MP_KEY_KPHOME, "KP_HOME" },
|
||||
{ MP_KEY_KPEND, "KP_END" },
|
||||
{ MP_KEY_KPPGUP, "KP_PGUP" },
|
||||
{ MP_KEY_KPPGDOWN, "KP_PGDWN" },
|
||||
{ MP_KEY_KPRIGHT, "KP_RIGHT" },
|
||||
{ MP_KEY_KPLEFT, "KP_LEFT" },
|
||||
{ MP_KEY_KPDOWN, "KP_DOWN" },
|
||||
{ MP_KEY_KPUP, "KP_UP" },
|
||||
{ MP_KEY_KPENTER, "KP_ENTER" },
|
||||
{ MP_MBTN_LEFT, "MBTN_LEFT" },
|
||||
{ MP_MBTN_MID, "MBTN_MID" },
|
||||
|
@ -106,6 +106,14 @@
|
||||
#define MP_KEY_KPINS (MP_KEY_KEYPAD+11)
|
||||
#define MP_KEY_KPDEL (MP_KEY_KEYPAD+12)
|
||||
#define MP_KEY_KPENTER (MP_KEY_KEYPAD+13)
|
||||
#define MP_KEY_KPHOME (MP_KEY_KEYPAD+14)
|
||||
#define MP_KEY_KPEND (MP_KEY_KEYPAD+15)
|
||||
#define MP_KEY_KPPGUP (MP_KEY_KEYPAD+16)
|
||||
#define MP_KEY_KPPGDOWN (MP_KEY_KEYPAD+17)
|
||||
#define MP_KEY_KPRIGHT (MP_KEY_KEYPAD+18)
|
||||
#define MP_KEY_KPLEFT (MP_KEY_KEYPAD+19)
|
||||
#define MP_KEY_KPDOWN (MP_KEY_KEYPAD+20)
|
||||
#define MP_KEY_KPUP (MP_KEY_KEYPAD+21)
|
||||
|
||||
// Mouse events from VOs
|
||||
#define MP_MBTN_BASE ((MP_KEY_BASE+0xA0)|MP_NO_REPEAT_KEY|MP_KEY_EMIT_ON_UP)
|
||||
|
@ -65,10 +65,10 @@ static const struct keymap vk_map[] = {
|
||||
{VK_DECIMAL, MP_KEY_KPDEC},
|
||||
|
||||
// numpad without numlock
|
||||
{VK_INSERT, MP_KEY_KPINS}, {VK_END, MP_KEY_KP1}, {VK_DOWN, MP_KEY_KP2},
|
||||
{VK_NEXT, MP_KEY_KP3}, {VK_LEFT, MP_KEY_KP4}, {VK_CLEAR, MP_KEY_KP5},
|
||||
{VK_RIGHT, MP_KEY_KP6}, {VK_HOME, MP_KEY_KP7}, {VK_UP, MP_KEY_KP8},
|
||||
{VK_PRIOR, MP_KEY_KP9}, {VK_DELETE, MP_KEY_KPDEL},
|
||||
{VK_INSERT, MP_KEY_KPINS}, {VK_END, MP_KEY_KPEND}, {VK_DOWN, MP_KEY_KPDOWN},
|
||||
{VK_NEXT, MP_KEY_KPPGDOWN}, {VK_LEFT, MP_KEY_KPLEFT}, {VK_CLEAR, MP_KEY_KP5},
|
||||
{VK_RIGHT, MP_KEY_KPRIGHT}, {VK_HOME, MP_KEY_KPHOME}, {VK_UP, MP_KEY_KPUP},
|
||||
{VK_PRIOR, MP_KEY_KPPGUP}, {VK_DELETE, MP_KEY_KPDEL},
|
||||
|
||||
{0, 0}
|
||||
};
|
||||
|
@ -112,11 +112,11 @@ static const struct mp_keymap keymap[] = {
|
||||
{XKB_KEY_KP_Decimal, MP_KEY_KPDEC}, {XKB_KEY_KP_Separator, MP_KEY_KPDEC},
|
||||
|
||||
/* Numpad without numlock */
|
||||
{XKB_KEY_KP_Insert, MP_KEY_KPINS}, {XKB_KEY_KP_End, MP_KEY_KP1},
|
||||
{XKB_KEY_KP_Down, MP_KEY_KP2}, {XKB_KEY_KP_Page_Down, MP_KEY_KP3},
|
||||
{XKB_KEY_KP_Left, MP_KEY_KP4}, {XKB_KEY_KP_Begin, MP_KEY_KP5},
|
||||
{XKB_KEY_KP_Right, MP_KEY_KP6}, {XKB_KEY_KP_Home, MP_KEY_KP7},
|
||||
{XKB_KEY_KP_Up, MP_KEY_KP8}, {XKB_KEY_KP_Page_Up, MP_KEY_KP9},
|
||||
{XKB_KEY_KP_Insert, MP_KEY_KPINS}, {XKB_KEY_KP_End, MP_KEY_KPEND},
|
||||
{XKB_KEY_KP_Down, MP_KEY_KPDOWN}, {XKB_KEY_KP_Page_Down, MP_KEY_KPPGDOWN},
|
||||
{XKB_KEY_KP_Left, MP_KEY_KPLEFT}, {XKB_KEY_KP_Begin, MP_KEY_KP5},
|
||||
{XKB_KEY_KP_Right, MP_KEY_KPRIGHT}, {XKB_KEY_KP_Home, MP_KEY_KPHOME},
|
||||
{XKB_KEY_KP_Up, MP_KEY_KPUP}, {XKB_KEY_KP_Page_Up, MP_KEY_KPPGUP},
|
||||
{XKB_KEY_KP_Delete, MP_KEY_KPDEL},
|
||||
|
||||
/* Multimedia keys */
|
||||
|
@ -736,11 +736,11 @@ static const struct mp_keymap keymap[] = {
|
||||
{XK_KP_Separator, MP_KEY_KPDEC},
|
||||
|
||||
// numpad without numlock
|
||||
{XK_KP_Insert, MP_KEY_KPINS}, {XK_KP_End, MP_KEY_KP1},
|
||||
{XK_KP_Down, MP_KEY_KP2}, {XK_KP_Page_Down, MP_KEY_KP3},
|
||||
{XK_KP_Left, MP_KEY_KP4}, {XK_KP_Begin, MP_KEY_KP5},
|
||||
{XK_KP_Right, MP_KEY_KP6}, {XK_KP_Home, MP_KEY_KP7}, {XK_KP_Up, MP_KEY_KP8},
|
||||
{XK_KP_Page_Up, MP_KEY_KP9}, {XK_KP_Delete, MP_KEY_KPDEL},
|
||||
{XK_KP_Insert, MP_KEY_KPINS}, {XK_KP_End, MP_KEY_KPEND},
|
||||
{XK_KP_Down, MP_KEY_KPDOWN}, {XK_KP_Page_Down, MP_KEY_KPPGDOWN},
|
||||
{XK_KP_Left, MP_KEY_KPLEFT}, {XK_KP_Begin, MP_KEY_KP5},
|
||||
{XK_KP_Right, MP_KEY_KPRIGHT}, {XK_KP_Home, MP_KEY_KPHOME}, {XK_KP_Up, MP_KEY_KPUP},
|
||||
{XK_KP_Page_Up, MP_KEY_KPPGUP}, {XK_KP_Delete, MP_KEY_KPDEL},
|
||||
|
||||
{XF86XK_MenuKB, MP_KEY_MENU},
|
||||
{XF86XK_AudioPlay, MP_KEY_PLAY}, {XF86XK_AudioPause, MP_KEY_PAUSE},
|
||||
|
Loading…
Reference in New Issue
Block a user