Skip to content

Commit

Permalink
Re-add "Left-click will be ignored for a short time after the focus w…
Browse files Browse the repository at this point in the history
…indow"

For 4a73dd1 the #39 (comment) shows regression, and it will conflict with other scripts.
  • Loading branch information
natural-harmonia-gropius authored Jan 30, 2024
1 parent 8b04d14 commit b5448b2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inputevent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,23 @@ function on_input_doubleclick_time_update(_, duration)
end
end

function on_focused_update(_, focused)
if not focused then
return
end

local binding = bind_map["MBTN_LEFT"]
if not binding then
return
end

binding:ignore("click", 100)
end

mp.register_script_message("bind", bind)
mp.register_script_message("unbind", unbind)
mp.observe_property("input-doubleclick-time", "native", on_input_doubleclick_time_update)
mp.observe_property("focused", "native", on_focused_update)
options.read_options(o, _, on_options_update)

bind_from_options_configs()

0 comments on commit b5448b2

Please sign in to comment.