-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Holding down a key only sends a single key on Mac #265
Comments
Oh apparently this is standard across Mac applications |
Yep, that's true. Even on native text areas in browser. We could create an add-on though to handle this, since the native terminal on OS X sends repeated keypress events. |
I think we should support this out of the box like the default terminal on Mac does. |
Just dumping some initial thoughts on this, because I did a little research… Terminal.app seems to not do anything special, it repeats every key that has no accented characters associated ( My first thought was, that its not possible to work around this, as it's a OS feature that can only be disabled global for all applications by the user or as a default setting in the applications .plist. JavaScript has no ability control this, in the case of VSCode this would need to be set somewhere in Electron. BUT: As it turns out, the browser receives the key event repeatedly even if the popup for the accented characters appears (tested on http://unixpapa.com/js/testkey.html): Although a little hackish, it might be possible to just listen to event, take the charcode (only accessible on the first event that gets fired, not sure why) from it and append it somehow back via The now still visible popup would be annoying, but it looks like it gets swallowed by xterm anyway, in the browser as well as inside VSCode: |
Was there ever any forward activity on this bug? We really feel that key-repeat in a terminal is sort of a crucial function, as in iTerm, Terminal.app, etc. Perhaps an addon exists that didn't make it to this thread? Thanks very much! |
I know the reason for this now; it happens because we're listening to keydown and keypress, not input which throws these repeated char events. We will also need to use input for proper emoji support on macOS #469 |
Is a fix on your radar, would you say? 👍 |
On radar yes, it's a blocker for Hyper to move over to xterm.js |
What's Hyper? |
A terminal emulator that is considering moving over: https://hyper.is/ |
Ah I thought maybe you meant that one. Have been using it on and off for the past year. Love the sparkles effect trail as you type! :-) So that means everything should work fine in Electron? |
@willkessler I embed xterm.js in VS Code which is also an Electron app, works great 😃 |
Original issue: microsoft/vscode#10398
Does not reproduce on Ubuntu 16.04
Details
Steps to reproduce
npm start
The text was updated successfully, but these errors were encountered: