-
Notifications
You must be signed in to change notification settings - Fork 15
Keybinding
New key bindings can be added through Keybinds.def_{g,p,q}. You can
specify key bindings to only execute when you are in the correct scope. Scope
here refers to Gomu panel, there are 3 different panel in Gomu; playlist, queue
and playingbar. But you can only specify the scope to only two panels;
playlist and queue.
For example you want to rebind quit to ctrl_w in playlist:
Keybinds.def_p("ctrl_w", quit)Remember that quit is a command which is also is just a function of type
func().
Global: Keybinds.def_g
Playlist: Keybinds.def_p
Queue: Keybinds.def_q
Keybinds.def_{g,q,p} is just a function defined in module Keybinds. The
function accepts two arguments which are keybind and function of type func().
For example you want to override the behaviour when you skip a song in gomu. You
can do this by simply using Keybinds.def_g.
Keybinds.def_g("n", func() {
skip()
info_popup("Skipped a song")
})In the above example, you simply show a popup while still able to skip a song.
You can also unmap keybinding by simply passing nil.
Keybinds.def_g("alt_u", nil)