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

Characters needing AltGr don't work in normal mode #12

Closed
kometenstaub opened this issue Apr 21, 2022 · 3 comments · Fixed by #22
Closed

Characters needing AltGr don't work in normal mode #12

kometenstaub opened this issue Apr 21, 2022 · 3 comments · Fixed by #22

Comments

@kometenstaub
Copy link
Contributor

kometenstaub commented Apr 21, 2022

In Vim mode, keyboard shortcuts such as fx, tx, vix don’t work if x is a character that requires pressing AltGr, such as {[]}€@\ on the German keyboard layout.

Downstream Bug report: https://forum.obsidian.md/t/vim-mode-shortcuts-involving-altgr-dont-work/36211

I can reproduce the bug in both Firefox and Chromium on Linux in the playground: https://codemirror-vim--util.repl.co/

The behaviour is different for each key. For { it jumps a paragraph up, for [ it activates the first of two [[ presses, on the second it jumps to the top of the document. For |, it goes to the beginning of the line.

@kometenstaub
Copy link
Contributor Author

I found the issue. The problem is that both AltGr and the converted key are sent. So on the keyboard it is AltGr+8, and codemirror receives (for the German locale) AltGr and [. Capturing and preventing AltGr fixes it.

@nightwing
Copy link
Collaborator

Does it work if you add AltGr to ignoredKeys at

var ignoredKeys: any = { Shift: 1, Alt: 1, Command: 1, Control: 1, CapsLock: 1 };
?

@kometenstaub
Copy link
Contributor Author

Yes, it does.

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

Successfully merging a pull request may close this issue.

2 participants