summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2026-01-18 23:51:28 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2026-01-18 23:51:28 -0800
commit0790f4366bcd46e21792ae233f1b1c6d29e7d150 (patch)
tree94a61784d1a3b31094621d11b4cef6975061c3db
parent664da9e0dfec80dc1cb49d1a1ffa4efa5b948607 (diff)
downloadmpv-iptv-menu-0790f4366bcd46e21792ae233f1b1c6d29e7d150.tar.gz
mpv-iptv-menu-0790f4366bcd46e21792ae233f1b1c6d29e7d150.tar.xz
prevent cursor hiding when hovering button
-rw-r--r--main.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/main.lua b/main.lua
index 563c2cf..bf853b6 100644
--- a/main.lua
+++ b/main.lua
@@ -1277,6 +1277,10 @@ local function toggle_menu()
set_key_bindings()
end
+mp.set_key_bindings({
+ {'MBTN_LEFT', toggle_menu},
+ {'MBTN_LEFT_DBL'},
+}, 'toggle_button', 'force')
local mouse_pos_time
local mouse_over_button_area = false
local mouse_over_toggle_button = false
@@ -1320,12 +1324,9 @@ mp.observe_property('mouse-pos', 'native', function(_, mpos)
if is_over ~= mouse_over_toggle_button then
mouse_over_toggle_button = is_over
if mouse_over_toggle_button then
- mp.add_forced_key_binding(
- 'MBTN_LEFT', 'click', toggle_menu)
- mp.add_forced_key_binding('MBTN_LEFT_DBL', 'click_dbl')
+ mp.enable_key_bindings('toggle_button')
else
- mp.remove_key_binding('click')
- mp.remove_key_binding('click_dbl')
+ mp.disable_key_bindings('toggle_button')
end
end
end)