natural-harmonia-gropius / input-event

InputEvent.lua for mpv-player, enhanced input.conf with better, conflict-free, low-latency event mechanism.
MIT License
45 stars 5 forks source link

[Question] How to write ignore statement in json conf #38

Closed verygoodlee closed 8 months ago

verygoodlee commented 10 months ago

In this case, both MBTN_LEFT double_click in json conf and MBTN_LEFT_DBL in input.conf have taken effect, double click cycle fullscreen twice.

# inputevent.conf
configs=~~/inputevent.json
[
  {
    "key": "MBTN_LEFT",
    "on": {
      "click": "cycle pause",
      "double_click": "cycle fullscreen"
    }
  },
  {
    "key": "MBTN_LEFT_DBL",
    "on": {
    }
  }
]
# input.conf
MBTN_LEFT cycle pause
MBTN_LEFT_DBL cycle fullscreen

In general, json conf overrides input.conf for the same keys, but the MBTN_LEFT_DBL can't be ignored.

verygoodlee commented 10 months ago

maybe it's a mpv bug, mp.add_forced_key_binding("MBTN_LEFT_DBL",...) doesn't overwrite the user's custom bindings in input.conf.

#input.conf
MBTN_LEFT_DBL show-text 'aaa'
--test.lua
mp.add_forced_key_binding("MBTN_LEFT_DBL", "MBTN_LEFT_DBL", function() 
    mp.commandv("show-text", "bbb")
end)

image binding success, but still show 'aaa'

update: Confirmed to be a bug in mpv mpv-player/mpv#13083

natural-harmonia-gropius commented 8 months ago

我的建议是不要绑定 _DBL , 逻辑上和 @double_click 冲突.