From 3871024ec32aaed04fe93a6b7af1c9d0df8f6248 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 27 Sep 2013 15:33:47 +0200 Subject: input: handle MOUSE_LEAVE specially Do this so that MOUSE_LEAVE can't be combined with other keys. (E.g. keep 'w' pressed, then move the mouse outside of the mpv window; it will print a warning what w-MOUSE_LEAVE is not mapped.) --- mpvcore/input/input.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mpvcore/input/input.c b/mpvcore/input/input.c index 9609f96c25..d318a0d7c5 100644 --- a/mpvcore/input/input.c +++ b/mpvcore/input/input.c @@ -1586,6 +1586,14 @@ static void mp_input_feed_key(struct input_ctx *ictx, int code, double scale) update_mouse_section(ictx); return; } + if (code == MP_KEY_MOUSE_LEAVE) { + update_mouse_section(ictx); + struct mp_cmd *cmd = get_cmd_from_keys(ictx, NULL, 1, (int[]){code}); + if (cmd) + queue_add_tail(&ictx->cmd_queue, cmd); + ictx->got_new_events = true; + return; + } double now = mp_time_sec(); int doubleclick_time = ictx->doubleclick_time; // ignore system-doubleclick if we generate these events ourselves -- cgit v1.2.3