summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-21 22:22:45 +0100
committerwm4 <wm4@nowhere>2019-11-22 01:15:08 +0100
commit0a6c09b96f17fa0247d3fe53ff396f61e5868d0c (patch)
tree576a79e4afd76d1c828d847eae62b936e598d883 /input/input.c
parenta098e981983bc38c916ec8c61fcde24f98dde1ab (diff)
downloadmpv-0a6c09b96f17fa0247d3fe53ff396f61e5868d0c.tar.bz2
mpv-0a6c09b96f17fa0247d3fe53ff396f61e5868d0c.tar.xz
input: introduce a pseudo key name that grabs all text input
The intended target for this is the mpv.repl script, which manually added every single ASCII key as a separate key binding. This provides a simpler mechanism, that will catch any kind of text input. Due to its special nature, explicitly do not give a guarantee for compatibility; thus the warning in input.rst.
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index 87956cf2b9..89ef1ace90 100644
--- a/input/input.c
+++ b/input/input.c
@@ -456,7 +456,12 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, char *force_section,
if (ictx->opts->test)
return handle_test(ictx, code);
- struct cmd_bind *cmd = find_any_bind_for_key(ictx, force_section, code);
+ struct cmd_bind *cmd = NULL;
+
+ if (MP_KEY_IS_UNICODE(code))
+ cmd = find_any_bind_for_key(ictx, force_section, MP_KEY_ANY_UNICODE);
+ if (!cmd)
+ cmd = find_any_bind_for_key(ictx, force_section, code);
if (!cmd)
cmd = find_any_bind_for_key(ictx, force_section, MP_KEY_UNMAPPED);
if (!cmd) {