summaryrefslogtreecommitdiffstats
path: root/input/keycodes.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-26 20:39:28 +0200
committerwm4 <wm4@nowhere>2014-08-26 20:39:28 +0200
commitb7f72aa2f401037177149dde1a178c55741b0ff2 (patch)
tree047f65d467e5168ba8cd64efcc9ef1bb0d359d0c /input/keycodes.h
parent480febf043be47f21b322c03abbcac953a67c468 (diff)
downloadmpv-b7f72aa2f401037177149dde1a178c55741b0ff2.tar.bz2
mpv-b7f72aa2f401037177149dde1a178c55741b0ff2.tar.xz
input: make key bindings like "Shift+X" work (for ASCII)
"Shift+X" didn't actually map any key, as opposed to "Shift+x". This is because shift usually changes the case of a character, so a plain printable character like "X" simply can never be combined with shift. But this is not very intuitive. Always remove the shift code from printable characters. Also, for ASCII, actually apply the case mapping to uppercase characters if combined with shift. Doing this for unicode in general would be nice, but that would require lookup tables. In general, we don't know anyway what character a key produces when combined with shift - it could be anything, and depends on the keyboard layout.
Diffstat (limited to 'input/keycodes.h')
-rw-r--r--input/keycodes.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/input/keycodes.h b/input/keycodes.h
index 4d13c653a3..53fb682e46 100644
--- a/input/keycodes.h
+++ b/input/keycodes.h
@@ -256,6 +256,9 @@
MP_KEY_MODIFIER_ALT | MP_KEY_MODIFIER_META | \
MP_KEY_STATE_DOWN | MP_KEY_STATE_UP)
+// Makes adjustments like turning "shift+z" into "Z"
+int mp_normalize_keycode(int keycode);
+
// Get input key from its name.
int mp_input_get_key_from_name(const char *name);