summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2020-11-16 18:15:18 +0200
committeravih <avih@users.noreply.github.com>2020-11-16 20:29:58 +0200
commit0d5055fe93e35770235902e11ff39b3231e6e1b8 (patch)
tree72f0cc55a1cb20b60d4e00d97b714245c975b7d9 /player/lua
parenta7686679564de584eaa720a6f682c8bd8ad062e6 (diff)
downloadmpv-0d5055fe93e35770235902e11ff39b3231e6e1b8.tar.bz2
mpv-0d5055fe93e35770235902e11ff39b3231e6e1b8.tar.xz
lua/js: mp.get_mouse_pos: use the mouse-pos property
mp.get_mouse_pos() is undocumented and is no longer required - the property can be used officially by any client now, however, osc.lua uses it, and also some user scripts learnt to rely on it, so we keep it - as a trivial wrapper around the new mouse-pos property.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/defaults.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/player/lua/defaults.lua b/player/lua/defaults.lua
index 95f8952f5d..920ee425aa 100644
--- a/player/lua/defaults.lua
+++ b/player/lua/defaults.lua
@@ -42,6 +42,11 @@ function mp.input_disable_section(section)
mp.commandv("disable-section", section)
end
+function mp.get_mouse_pos()
+ local m = mp.get_property_native("mouse-pos")
+ return m.x, m.y
+end
+
-- For dispatching script-binding. This is sent as:
-- script-message-to $script_name $binding_name $keystate
-- The array is indexed by $binding_name, and has functions like this as value: