summaryrefslogtreecommitdiff
path: root/mpv/scripts/file-browser/modules/defs/keybind.lua
blob: a903d46cd66029f2415c6d156cfab26e298049a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---@meta _

---@class KeybindFlags
---@field repeatable boolean?
---@field scalable boolean?
---@field complex boolean?


---@class KeybindCommandTable


---@class Keybind
---@field key string
---@field command KeybindCommand
---@field api_version string?
---
---@field name string?
---@field condition string?
---@field flags KeybindFlags?
---@field filter ('file'|'dir')?
---@field parser string?
---@field multiselect boolean?
---@field multi-type ('repeat'|'concat')?
---@field delay number?
---@field concat-string string?
---@field passthrough boolean?
---
---@field prev_key Keybind?     The keybind that was previously set to the same key.
---@field codes Set<string>?     Any substituation codes used by the command table.
---@field condition_codes Set<string>?   Any substitution codes used by the condition string.
---@field addon boolean?    Whether the keybind was created by an addon.


---@alias KeybindFunctionCallback async fun(keybind: Keybind, state: State, co: thread)

---@alias KeybindCommand KeybindFunctionCallback|KeybindCommandTable[]
---@alias KeybindTuple [string,string,KeybindCommand,KeybindFlags?]
---@alias KeybindTupleStrict [string,string,KeybindFunctionCallback,KeybindFlags?]
---@alias KeybindList (Keybind|KeybindTuple)[]