From 0790f4366bcd46e21792ae233f1b1c6d29e7d150 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 18 Jan 2026 23:51:28 -0800 Subject: prevent cursor hiding when hovering button --- main.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main.lua') 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) -- cgit v1.2.3-70-g09d2