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

Issues with alt+left #2103

Open
anchpop opened this issue May 13, 2019 · 0 comments
Open

Issues with alt+left #2103

anchpop opened this issue May 13, 2019 · 0 comments

Comments

@anchpop
Copy link

anchpop commented May 13, 2019

First, let me express my thankfulness to the Hammerspoon developers for creating such a useful and well-designed piece of software. Currently, I'm trying to use Hammerspoon to write some custom shortcuts on my Macbook. Specifically, I want the cmd+left shortcut (which traditionally moves the cursor to the beginning of the line) to have the behavior of the alt+left shortcut (which traditionally moves the cursor one "word" backwards). I tried putting this in my init.lua:

hs.loadSpoon("ReloadConfiguration")
spoon.ReloadConfiguration:start()

hs.hotkey.bind({"cmd"}, "Left", function()
  hs.eventtap.keyStroke({"alt"}, 'Left')
end)

And it compiles successfully and stops the cmd+left shortcut from moving the cursor to the beginning of the line, but it seems like the alt+left keystroke does not always get emitted, triggering only about 40-60% of the time. This means most of the time pressing cmd+left does nothing. Any ideas on how to fix this?

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

1 participant