Hammerspoon/hammerspoon

hotkey.modal that ignores anything but given hotkeys

开放

#1,505 创建于 2017年7月30日

 (12 条评论) (0 个反应) (1 位负责人)Objective-C (688 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (15,415 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Is it possible to have a hs.hotkey.modal with a few bindings that would ignore all the other keys. Let's say if I have:

local myModal = hs.hotkey.modal.new({"cmd"}, "space")
myModal:bind("", "g", nil, openGoogleChrome())
myModal:bind("", "f", nil, openFirefox())
myModal:bind("", "s", nil, openSafari())

Then if I press cmd+space, it will activate the modal, in which it would only respond to g, f, and s. Any other keys would be simply ignored. Is that even possible?

贡献者指南