Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting "hyper" to mods only crashes Hammerspoon #84

Closed
ihodes opened this issue Mar 25, 2021 · 3 comments
Closed

Setting "hyper" to mods only crashes Hammerspoon #84

ihodes opened this issue Mar 25, 2021 · 3 comments

Comments

@ihodes
Copy link

ihodes commented Mar 25, 2021

E.g. from the README:

(local config
       {:title "Main Menu"
        :items menu-items
        :keys  common-keys
        :enter (fn [] (windows.hide-display-numbers))
        :exit  (fn [] (windows.hide-display-numbers))
        :apps  apps
        :hyper {:mods [:shift :alt :cmd :ctrl]}})

Results in this error:

2021-03-25 18:22:12: *** ERROR: ...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:416: key must be a string or a number
stack traceback:
	[C]: in function 'error'
	...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:20: in upvalue 'getKeycode'
	...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:195: in function 'hs.hotkey.new'
	...oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:416: in function 'hs.hotkey.bind'
	(...tail calls...)
	./core.fnl:98: in upvalue 'f'
	./lib/functional.fnl:144: in local 'f'
	./lib/functional.fnl:124: in function 'lib.functional.reduce'
	(...tail calls...)
	./core.fnl:100: in main chunk
	(...tail calls...)
	[C]: in function 'rawrequire'
	...app/Contents/Resources/extensions/hs/_coresetup/init.lua:651: in function 'require'
	/Users/isaachodes/.hammerspoon/init.lua:25: in main chunk
	[C]: in function 'xpcall'
	...app/Contents/Resources/extensions/hs/_coresetup/init.lua:702: in function 'hs._coresetup.setup'
	(...tail calls...)
@jaidetree
Copy link
Collaborator

.oon.app/Contents/Resources/extensions/hs/hotkey/init.lua:416 that is a limitation of Hammerspoon currently. When #72 gets completed that could provide a reasonable entrypoint to allow users to replace the underlying machinery. In this case we're using the hs.hotkey functionality which is more opinionated. With an advising system in place you would be able to redefine the one function responsible for listening for hotkeys and use the raw hs.eventtap functionality instead.

@Grazfather
Copy link
Collaborator

I just noticed the same. The config in the main readme (hyper section) itself causes this crash, so it should probably be removed.

valrus added a commit to valrus/spacehammer that referenced this issue Jun 11, 2021
...it crashes hammerspoon. This causes some confusion e.g. agzam#84.
Also the preceding paragraph refers to F18, so just use that instead.
@Grazfather
Copy link
Collaborator

This suggestion was removed from the readme, since we can't support it due to hammerspoon itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants