mpv/input
wm4 b18c2d9fe2 input: restore ability to combine mouse buttons
Key bindings are decided on the "down" event, so if the prefix is not
unique, the first/shortest will be used (e.g. when both "a" and "a-b"
are mapped, "a" will always be chosen).

This also breaks combining multiple mouse buttons. But it seems users
expect it to work, and it's indeed a bit strange that it shouldn't work,
as mouse bindings are emitted on the key "up" event, not "down" (if the
shorter binding didn't emit a command yet, why shouldn't it be
combinable).

Deal with this by clearing the key history when a command is actually
emitted, instead of when a command is decided. This means if both
MOUSE_BTN0 and MOUSE_BTN0-MOUSE_BTN1 are mapped, the sequence of holding
down BTN0 and then BTN1 will redecide the current command. On the other
hand, if BTN0 is released before BTN1 is pressed, the command is
emitted, and the key history is deleted. So the BTN1 press will not
trigger BTN0-BTN1.

For normal keys, nothing should change, because commands are emitted on
the "down" event already, so the key history is always cleared.

Might fix #902.

CC: @mpv-player/stable (if this fix is successful)
2014-07-08 10:11:07 +02:00
..
cmd_list.c command: redo ancient TV/DVB/PVR commands 2014-06-11 00:34:41 +02:00
cmd_list.h command: redo ancient TV/DVB/PVR commands 2014-06-11 00:34:41 +02:00
cmd_parse.c input: remove pausing command prefixes 2014-05-11 15:41:34 +02:00
cmd_parse.h
event.c input: change mp_input_run_cmd signature 2014-01-04 19:42:16 +01:00
event.h
input.c input: restore ability to combine mouse buttons 2014-07-08 10:11:07 +02:00
input.h input: remove pausing command prefixes 2014-05-11 15:41:34 +02:00
joystick.c Kill all tabs 2014-04-13 18:03:01 +02:00
joystick.h
keycodes.c keycodes: add const to a function argument 2014-02-17 02:52:58 +01:00
keycodes.h input: fix typos, cosmetics 2014-05-10 10:44:15 +02:00
lirc.c Kill all tabs 2014-04-13 18:03:01 +02:00
lirc.h