diff options
author | wm4 <wm4@nowhere> | 2013-09-27 15:33:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-27 15:33:47 +0200 |
commit | 3871024ec32aaed04fe93a6b7af1c9d0df8f6248 (patch) | |
tree | 842a0835318a23e2a63f422fb234404b4b16ab2f /mpvcore/input | |
parent | 0d90dd07ff5269bf3492004d31ec0f4bd0b6d113 (diff) | |
download | mpv-3871024ec32aaed04fe93a6b7af1c9d0df8f6248.tar.bz2 mpv-3871024ec32aaed04fe93a6b7af1c9d0df8f6248.tar.xz |
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.)
Diffstat (limited to 'mpvcore/input')
-rw-r--r-- | mpvcore/input/input.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 |