mirror of https://github.com/mpv-player/mpv
console: manually map numeric keypad (KP*) bindings
While mpv normally uses the text a key produces (as opposed to physical key mappings), this is different with the keypad. This is for the sake of making it possible to distinguish between these keys and the normal number keys on the left side of a full size keyboard. There were complaints that the keypad doesn't interact with console.lua, so manually map them. This ignores numlock (behaves as if it's always on), and maps KP_DEC to "." (even though it's mapped to "," on some keyboards). The /*-+ keys produce ASCII on mpv (at least with X11) as an inexplicable inconsistency, so there are no mappings for these. Fixes: #7431
This commit is contained in:
parent
c33bbc8694
commit
f659cfd6e3
|
@ -653,6 +653,7 @@ end
|
|||
local bindings = {
|
||||
{ 'esc', function() set_active(false) end },
|
||||
{ 'enter', handle_enter },
|
||||
{ 'kp_enter', hanmdle_enter },
|
||||
{ 'shift+enter', function() handle_char_input('\n') end },
|
||||
{ 'bs', handle_backspace },
|
||||
{ 'shift+bs', handle_backspace },
|
||||
|
@ -684,8 +685,14 @@ local bindings = {
|
|||
{ 'ctrl+v', function() paste(true) end },
|
||||
{ 'meta+v', function() paste(true) end },
|
||||
{ 'ctrl+w', del_word },
|
||||
{ 'kp_dec', function() handle_char_input('.') end },
|
||||
}
|
||||
|
||||
for i = 0, 9 do
|
||||
bindings[#bindings + 1] =
|
||||
{'kp' .. i, function() handle_char_input('' .. i) end}
|
||||
end
|
||||
|
||||
local function text_input(info)
|
||||
if info.key_text and (info.event == "press" or info.event == "down"
|
||||
or info.event == "repeat")
|
||||
|
|
Loading…
Reference in New Issue