summaryrefslogtreecommitdiffstats
path: root/mpvcore/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-28 00:33:52 +0100
committerwm4 <wm4@nowhere>2013-10-28 00:33:52 +0100
commit5e9c226229087cb6b594795e1c83dc6efb105a31 (patch)
tree705e0658a68e10f1decc916b78adb43e0c8318de /mpvcore/input
parentf2d438a1fd395fff0304594c35d46a3891d0ad65 (diff)
downloadmpv-5e9c226229087cb6b594795e1c83dc6efb105a31.tar.bz2
mpv-5e9c226229087cb6b594795e1c83dc6efb105a31.tar.xz
command: disable autorepeat for some commands (actually properties)
Disable autorepeat for the "add"/"cycle" commands when changing properties that are choices (such as fullscreen, pause, and more). In these cases, autorepeat is not very useful, and can rather harmful effects (like triggering too many repeated commands if command execution is slow). (Actually, the commands are just dropped _after_ being repeated, since input.c itself does not know enough about the commands to decide whether or not they should be repeated.)
Diffstat (limited to 'mpvcore/input')
-rw-r--r--mpvcore/input/input.c4
-rw-r--r--mpvcore/input/input.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c
index b26f2d491d..5b74f1aa33 100644
--- a/mpvcore/input/input.c
+++ b/mpvcore/input/input.c
@@ -1877,8 +1877,10 @@ mp_cmd_t *mp_input_get_cmd(struct input_ctx *ictx, int time, int peek_only)
struct cmd_queue *queue = &ictx->cmd_queue;
if (!queue->first) {
struct mp_cmd *repeated = check_autorepeat(ictx);
- if (repeated)
+ if (repeated) {
+ repeated->repeated = true;
queue_add_tail(queue, repeated);
+ }
}
struct mp_cmd *ret = queue_peek(queue);
if (ret && !peek_only) {
diff --git a/mpvcore/input/input.h b/mpvcore/input/input.h
index dc308ff9f6..3e8da7eb75 100644
--- a/mpvcore/input/input.h
+++ b/mpvcore/input/input.h
@@ -154,6 +154,7 @@ typedef struct mp_cmd {
bstr original;
char *input_section;
bool key_up_follows;
+ bool repeated;
bool mouse_move;
int mouse_x, mouse_y;
struct mp_cmd *queue_next;