uivonim icon indicating copy to clipboard operation
uivonim copied to clipboard

Key repeat not working on MacOS

Open metalelf0 opened this issue 4 years ago • 6 comments

I'm currently on MacOS 11.1 and the key repeat isn't working: holding a key only sends a single char event. Not a big deal, it's like a "hardcore mode" built in, but some users might find it useful :)

Keep up the great work!

metalelf0 avatar Jan 26 '21 16:01 metalelf0

@metalelf0 Hello, thanks for the issue! This is something I have actually noticed myself, but I haven't taken the time to look into it yet. Hopefully I'll be able to do so soon!

smolck avatar Jan 26 '21 16:01 smolck

Hmm, so after some further looking into it, I think this is actually a macOS preferences thing. If you go into System Preferences > Keyboard, you can change the values for Key Repeat and Delay Until Repeat to what you want.

That is system-wide though. There might be a way to do it on an application-specific basis, but I'm new to macOS and so wouldn't know; regardless, I think this can be closed, since this isn't an uivonim issue? Unless I'm mistaken?

smolck avatar Jan 26 '21 19:01 smolck

Hmm, my system settings are already on very fast keyboard repeat, so it shouldn't be related. I'll try to look into this as well and I'll let you know if I find anything relevant.

metalelf0 avatar Jan 26 '21 19:01 metalelf0

Have you already seen https://github.com/xtermjs/xterm.js/pull/1849/files ? I'm no js/electron dev, but this seems related.

metalelf0 avatar Jan 26 '21 20:01 metalelf0

So, based on that PR (which I had not seen, so thank you for mentioning it) and if I understand correctly, I'd need to use different events (or change up some logic) to get keypresses in normal mode so holding a key down repeats as expected, but when in insert mode the hold dialog appears as intended. This may or may not work/be feasible though, so I'll have to try it out and go from there.

For the time being though, you can run this command as a workaround: $ defaults write -g ApplePressAndHoldEnabled -bool false

Of course, having to do that for a single application to work as desired is not ideal, so hopefully there's a straightforward solution (likely based on the one in that PR).

smolck avatar Jan 26 '21 20:01 smolck

defaults write com.uivonim.uivonim ApplePressAndHoldEnabled -bool false should do it for a single app

xukai92 avatar Feb 20 '21 02:02 xukai92