diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2019-12-25 20:52:19 +0200 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2020-11-16 20:29:58 +0200 |
commit | 58004ea2ef1a14da51b3f46e1c8565c0a3a91ee0 (patch) | |
tree | 80801338176bfee806bfd98b6904a804fabec527 /input/input.h | |
parent | 0d5055fe93e35770235902e11ff39b3231e6e1b8 (diff) | |
download | mpv-58004ea2ef1a14da51b3f46e1c8565c0a3a91ee0.tar.bz2 mpv-58004ea2ef1a14da51b3f46e1c8565c0a3a91ee0.tar.xz |
command: mouse-pos property: add field "hover"
Add a third field: "hover", which is updated from input.c after input
keys MP_KEY_MOUSE_LEAVE and MP_KEY_MOUSE_ENTER - which are typically
sent by the VO.
It's part of mouse-pos and not a new property because it's highly tied
to mouse-pos - it makes x/y invalid while the cursor doesn't hover the
window.
Unike mouse-move, no dummy command was generated, so we add dummy
command in order for observer notification to work even while nothing
is bound.
Like mouse-pos, clients could not detect whether the mouse pointer
hovers the window because the OSC force-binds the MOUSE_LEAVE key, and
now they can using the hover field.
The lua mp.get_mouse_pos() wrapper still returns only x, y because
that's what osc.lua needs. Other clients can simply read the property.
Diffstat (limited to 'input/input.h')
-rw-r--r-- | input/input.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/input/input.h b/input/input.h index 82e7adc503..5b5e7a99ce 100644 --- a/input/input.h +++ b/input/input.h @@ -99,7 +99,7 @@ void mp_input_set_mouse_pos(struct input_ctx *ictx, int x, int y); // Like mp_input_set_mouse_pos(), but ignore mouse disable option. void mp_input_set_mouse_pos_artificial(struct input_ctx *ictx, int x, int y); -void mp_input_get_mouse_pos(struct input_ctx *ictx, int *x, int *y); +void mp_input_get_mouse_pos(struct input_ctx *ictx, int *x, int *y, int *hover); // Return whether we want/accept mouse input. bool mp_input_mouse_enabled(struct input_ctx *ictx); |