summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--input/input.c2
-rw-r--r--input/keycodes.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c
index 324f9f250d..ca3f63784d 100644
--- a/input/input.c
+++ b/input/input.c
@@ -692,6 +692,8 @@ static void mp_input_feed_key(struct input_ctx *ictx, int code, double scale)
release_down_cmd(ictx, false);
return;
}
+ if (!ictx->opts->enable_mouse_movements && MP_KEY_IS_MOUSE(unmod))
+ return;
if (unmod == MP_KEY_MOUSE_LEAVE) {
update_mouse_section(ictx);
struct mp_cmd *cmd = get_cmd_from_keys(ictx, NULL, code);
diff --git a/input/keycodes.h b/input/keycodes.h
index 9e890fc166..49a7f8d533 100644
--- a/input/keycodes.h
+++ b/input/keycodes.h
@@ -222,6 +222,9 @@
(MP_KEY_IS_MOUSE_BTN_SINGLE(code) || MP_KEY_IS_MOUSE_BTN_DBL(code) || \
(code) == MP_KEY_MOUSE_MOVE)
+#define MP_KEY_IS_MOUSE(code) \
+ (MP_KEY_DEPENDS_ON_MOUSE_POS(code) || (code) == MP_KEY_MOUSE_LEAVE)
+
// Emit a command even on key-up (normally key-up is ignored). This means by
// default they binding will be triggered on key-up instead of key-down.
// This is a fixed part of the keycode, not a modifier than can change.