summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
Diffstat (limited to 'input')
-rw-r--r--input/cmd_list.c3
-rw-r--r--input/cmd_parse.c3
-rw-r--r--input/input.c3
-rw-r--r--input/input.h1
4 files changed, 7 insertions, 3 deletions
diff --git a/input/cmd_list.c b/input/cmd_list.c
index c1413f7dd9..e0e307b4c4 100644
--- a/input/cmd_list.c
+++ b/input/cmd_list.c
@@ -297,7 +297,8 @@ bool mp_input_is_abort_cmd(struct mp_cmd *cmd)
bool mp_input_is_repeatable_cmd(struct mp_cmd *cmd)
{
return (cmd->def && cmd->def->allow_auto_repeat) ||
- cmd->id == MP_CMD_COMMAND_LIST;
+ cmd->id == MP_CMD_COMMAND_LIST ||
+ (cmd->flags & MP_ALLOW_REPEAT);
}
void mp_print_cmd_list(struct mp_log *out)
diff --git a/input/cmd_parse.c b/input/cmd_parse.c
index 7fdce93901..51b56d9565 100644
--- a/input/cmd_parse.c
+++ b/input/cmd_parse.c
@@ -47,8 +47,9 @@ static const struct flag cmd_flags[] = {
{"osd-msg", MP_ON_OSD_FLAGS, MP_ON_OSD_MSG},
{"osd-msg-bar", MP_ON_OSD_FLAGS, MP_ON_OSD_MSG | MP_ON_OSD_BAR},
{"osd-auto", MP_ON_OSD_FLAGS, MP_ON_OSD_AUTO},
- {"expand-properties", 0, MP_EXPAND_PROPERTIES},
+ {"expand-properties", 0, MP_EXPAND_PROPERTIES},
{"raw", MP_EXPAND_PROPERTIES, 0},
+ {"repeatable", 0, MP_ALLOW_REPEAT},
{0}
};
diff --git a/input/input.c b/input/input.c
index 52c28123ef..cdfb507b34 100644
--- a/input/input.c
+++ b/input/input.c
@@ -883,7 +883,8 @@ mp_cmd_t *mp_input_read_cmd(struct input_ctx *ictx)
struct mp_cmd *ret = queue_remove_head(&ictx->cmd_queue);
if (!ret) {
ret = check_autorepeat(ictx);
- if (ret)
+ // (if explicitly repeated, don't let command.c ignore it)
+ if (ret && !(ret->flags & MP_ALLOW_REPEAT))
ret->repeated = true;
}
if (ret && ret->mouse_move) {
diff --git a/input/input.h b/input/input.h
index 8e6edcfa02..6da1f719c2 100644
--- a/input/input.h
+++ b/input/input.h
@@ -34,6 +34,7 @@ enum mp_cmd_flags {
MP_ON_OSD_BAR = 2, // force a bar, if applicable
MP_ON_OSD_MSG = 4, // force a message, if applicable
MP_EXPAND_PROPERTIES = 8, // expand strings as properties
+ MP_ALLOW_REPEAT = 16, // if used as keybinding, allow key repeat
MP_ON_OSD_FLAGS = MP_ON_OSD_NO | MP_ON_OSD_AUTO |
MP_ON_OSD_BAR | MP_ON_OSD_MSG,