codemirror-vim icon indicating copy to clipboard operation
codemirror-vim copied to clipboard

Dead keys don't work as expected in normal mode

Open kometenstaub opened this issue 2 years ago • 2 comments

Dead keys such as the backtick and ^ (German keyboard layout), when pressed in normal mode, insert the character directly into the text instead of waiting for a space or some other character.

This makes it (as examples) impossible to use ^ for going to the beginning of a line or using the backtick in f motions.

kometenstaub avatar Apr 21 '22 09:04 kometenstaub

From what I have read, it is not possible to read the dead key on the keyboard event at keydown The Dead key (at least in normal mode) would need to be ignored and a compositionupdate event handler would need to be added to accept the shortcuts

I think code could be reused from the keydown event; i'll try and make a patch

edit: some references:

  • keyboard events: https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
  • composition update how to https://developer.mozilla.org/en-US/docs/Web/API/Element/compositionupdate_event

covert8 avatar May 27 '22 11:05 covert8

I wonder whether it's similar to #12/#22.

(I fixed it for myself by disabling dead keys, but that's only a personal solution.)

kometenstaub avatar Jun 27 '22 13:06 kometenstaub