You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
482 B
16 lines
482 B
(local mash [:cmd :alt :ctrl])
|
|
(local smash [:shift :cmd :alt :ctrl])
|
|
|
|
(fn modal-bind [mods key message bindings]
|
|
(let [modal (hs.hotkey.modal.new mods key message)]
|
|
(tset modal :entered #(hs.timer.doAfter 1 #(modal:exit)))
|
|
;; (tset modal :exited #(hs.alert :bye))
|
|
(each [_ [mods key message f] (ipairs bindings)]
|
|
(modal:bind mods key message
|
|
#(do
|
|
(f)
|
|
(modal:exit))))))
|
|
|
|
{: mash : smash : modal-bind}
|
|
|