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

Option to customise key repeat rate. #1216

Closed
franciscolourenco opened this issue Jan 29, 2017 · 9 comments
Closed

Option to customise key repeat rate. #1216

franciscolourenco opened this issue Jan 29, 2017 · 9 comments

Comments

@franciscolourenco
Copy link

franciscolourenco commented Jan 29, 2017

Hammerspoon KeyEvents repeat rate is bound to the key repeat rate set in the System Preferences.

screen shot 2017-01-30 at 00 05 07

That means that if you customise the key repeat rate with Karabiner, the key repeat rate of keys mapped with Hammerspoon, is going to be different than the repeat rate set with Karabiner.

screen shot 2017-01-24 at 14 27 01

On the other hand Karabiner doesn't support macOS Sierra, so there is no way to increase the key repeat rate going forward.

Would it be technically feasible to have a global or newKeyEvent option, that lets the key repeat rate be increased further?


Example application

local function keyCode(key, modifiers)
  modifiers = modifiers or {}

  return function()
    hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post()
    hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post()
  end
end


hs.hotkey.bind({'ctrl'}, 'j', keyCode('left'), nil, keyCode('left'))
hs.hotkey.bind({'ctrl'}, 'k', keyCode('down'), nil, keyCode('down'))
hs.hotkey.bind({'ctrl'}, 'i', keyCode('up'), nil, keyCode('up'))
hs.hotkey.bind({'ctrl'}, 'l', keyCode('right'), nil, keyCode('right'))
@cmsj
Copy link
Member

cmsj commented Feb 7, 2017

@aristidesfl I'm not 100% sure if it's wired up to anything, but the prefs UI in Karabiner Elements has options for setting the keyboard repeat rate, and works on macOS Sierra. We could look at adding some API for controlling Hammerspoon's repeat rate, but I'd like to know how things sit with Karabiner Elements first.

@franciscolourenco
Copy link
Author

@cmsj I can't find the options for setting the keyboard repeat rate in Karabiner Elements. Can you share a screenshot?

@cmsj
Copy link
Member

cmsj commented Feb 7, 2017

hmm, for me it's in the preferences as another tab, but I am using an older, third party fork of Elements, so it may not be in the main repo yet.

@franciscolourenco
Copy link
Author

Don't see any pull requests with that feature

@franciscolourenco
Copy link
Author

It is no longer supported pqrs-org/Karabiner-Elements#551

@cmsj
Copy link
Member

cmsj commented Feb 7, 2017

Oh, damn :(

@franciscolourenco
Copy link
Author

This seems to work be working fine with hammerspoon

defaults write NSGlobalDomain KeyRepeat -float 1.3
defaults write NSGlobalDomain InitialKeyRepeat -int 11

@megalithic
Copy link

megalithic commented Jun 10, 2020

@franciscolourenco could you confirm if this is still working for you? presently not getting the same repeat interval with the repeatfn for a hotkey model bind constructor.

@franciscolourenco
Copy link
Author

@megalithic I've not used Hammerspoon for a while, but I still use those settings in macOS. I could test it if it is important.

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