natural-harmonia-gropius / input-event

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

Several improvements for config #26

Closed natural-harmonia-gropius closed 1 year ago

natural-harmonia-gropius commented 1 year ago

Key bindings in different files are override rather than merged.

close #22

mpv.conf

script-opts-add=inputevent-configs="input.conf,~~/test.conf,~~/test.json"

input.conf

SPACE               cycle pause         #@click
SPACE               set speed  2.0      #@press
SPACE               set speed  1.0      #@release

test.conf

SPACE               set speed  0.5      #@press
SPACE               set speed  1.0      #@release

test.json

[
  {
    "key": "SPACE",
    "on": {
      "click": "show-text click",
      "double_click": "show-text double-click",
      "penta_click": "show-text penta-click",
      "press": "show-text pressed",
      "quatra_click": "show-text quatra-click",
      "release": "show-text released",
      "repeat": "show-text repeat",
      "triple_click": "show-text triple-click"
    }
  }
]

Update configs in runtime

mpv.conf

[fullscreen]
profile-cond=fullscreen
profile-restore=copy-equal
script-opts-add=inputevent-configs="input.conf,~~/test.json"
natural-harmonia-gropius commented 1 year ago

@zhongfly 这样的实现可以吗?

zhongfly commented 1 year ago

@zhongfly 这样的实现可以吗?

我觉得虽然能满足要求,但是不方便… 对于每种不同的条件都需要单独一个配置,不够方便