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

Support property-expansion for command #21

Closed natural-harmonia-gropius closed 1 year ago

natural-harmonia-gropius commented 1 year ago

Syntax: property-expansion

Example:

input.conf

set output TRC to be the same as input.

set target-trc ${video-params/gamma}

ternary operators like.

set target-trc ${?video-params/gamma==pq:hlg}${!video-params/gamma==pq:bt.1886}

evafast like speedup.

SPACE           cycle pause                                                                 #@click
SPACE           no-osd set speed 1; set pause no                                            #@press
SPACE           ignore                                                                      #@release
SPACE           no-osd add speed ${?speed==4.00:0}${!speed==4.00:0.1}; show-text ${speed}   #@repeat

TODO:

zhongfly commented 1 year ago

第二点: command_invert里用分号分隔也会有类似问题,命令是set title "example; 6666; 7777"就会分割错误变成{'set title "example','666','777"'}处理第2,3个元素时local property = subs[prefix == "" and 2 or 3]应该就会报错