diff options
author | torque <torque@1> | 2015-02-16 21:50:57 -0800 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-18 00:03:16 +0100 |
commit | 3b269ac0a04b7575a8ab1a6665d75fc0d0e8589e (patch) | |
tree | 9b637249e3225cebe664724280a30918c0e7a8a3 /input/input.c | |
parent | fa9b587426d7bd350d92afdb440c396336b2ecfd (diff) | |
download | mpv-3b269ac0a04b7575a8ab1a6665d75fc0d0e8589e.tar.bz2 mpv-3b269ac0a04b7575a8ab1a6665d75fc0d0e8589e.tar.xz |
input: add MOUSE_ENTER keybinding.
Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'input/input.c')
-rw-r--r-- | input/input.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c index ecf897a9c2..55344be779 100644 --- a/input/input.c +++ b/input/input.c @@ -463,8 +463,11 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, char *force_section, if (code == MP_KEY_CLOSE_WIN) return mp_input_parse_cmd_strv(ictx->log, (const char*[]){"quit", 0}); int msgl = MSGL_WARN; - if (code == MP_KEY_MOUSE_MOVE || code == MP_KEY_MOUSE_LEAVE) + if (code == MP_KEY_MOUSE_MOVE || code == MP_KEY_MOUSE_LEAVE || + code == MP_KEY_MOUSE_ENTER) + { msgl = MSGL_DEBUG; + } char *key_buf = mp_input_get_key_combo_name(&code, 1); MP_MSG(ictx, msgl, "No bind found for key '%s'.\n", key_buf); talloc_free(key_buf); @@ -635,6 +638,10 @@ static void mp_input_feed_key(struct input_ctx *ictx, int code, double scale) update_mouse_section(ictx); mp_input_queue_cmd(ictx, get_cmd_from_keys(ictx, NULL, code)); return; + } else if (unmod == MP_KEY_MOUSE_ENTER) { + update_mouse_section(ictx); + mp_input_queue_cmd(ictx, get_cmd_from_keys(ictx, NULL, code)); + return; } double now = mp_time_sec(); // ignore system-doubleclick if we generate these events ourselves |