summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-26 21:49:14 +0200
committerwm4 <wm4@nowhere>2014-06-14 13:49:55 +0200
commit7e61bf134a30c0154ca2d0cf841cc38e79e4f167 (patch)
tree269653e67f9aea972a1576e3c331b3e3a4c3f798
parent61a2f3d2bf01ce02a74306abe730be49163ad457 (diff)
downloadmpv-7e61bf134a30c0154ca2d0cf841cc38e79e4f167.tar.bz2
mpv-7e61bf134a30c0154ca2d0cf841cc38e79e4f167.tar.xz
input: make combined commands repeatable
Binding multiple commands at once where always considered not repeatable, because the MP_CMD_COMMAND_LIST wasn't considered repeatable. Fixes #807 (probably).
-rw-r--r--input/cmd_list.c6
-rw-r--r--input/cmd_list.h2
-rw-r--r--input/input.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/input/cmd_list.c b/input/cmd_list.c
index d49d63f144..141e000c24 100644
--- a/input/cmd_list.c
+++ b/input/cmd_list.c
@@ -278,6 +278,12 @@ bool mp_input_is_abort_cmd(struct mp_cmd *cmd)
return false;
}
+bool mp_input_is_repeatable_cmd(struct mp_cmd *cmd)
+{
+ return (cmd->def && cmd->def->allow_auto_repeat) ||
+ cmd->id == MP_CMD_COMMAND_LIST;
+}
+
void mp_print_cmd_list(struct mp_log *out)
{
for (int i = 0; mp_cmds[i].name; i++) {
diff --git a/input/cmd_list.h b/input/cmd_list.h
index 870294cfaf..9aa5b69256 100644
--- a/input/cmd_list.h
+++ b/input/cmd_list.h
@@ -110,6 +110,8 @@ enum mp_command_type {
struct mp_cmd;
bool mp_input_is_abort_cmd(struct mp_cmd *cmd);
+bool mp_input_is_repeatable_cmd(struct mp_cmd *cmd);
+
struct bstr;
bool mp_replace_legacy_cmd(void *talloc_ctx, struct bstr *s);
diff --git a/input/input.c b/input/input.c
index 56c21b4fe1..041183a940 100644
--- a/input/input.c
+++ b/input/input.c
@@ -517,7 +517,7 @@ static void update_mouse_section(struct input_ctx *ictx)
}
// Called when the currently held-down key is released. This (usually) sends
-// the a key-up versiob of the command associated with the keys that were held
+// the a key-up version of the command associated with the keys that were held
// down.
// If the drop_current parameter is set to true, then don't send the key-up
// command. Unless we've already sent a key-down event, in which case the
@@ -1155,7 +1155,7 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only)
struct mp_cmd *repeated = check_autorepeat(ictx);
if (repeated) {
repeated->repeated = true;
- if (repeated->def && repeated->def->allow_auto_repeat) {
+ if (mp_input_is_repeatable_cmd(repeated)) {
queue_add_tail(queue, repeated);
} else {
talloc_free(repeated);