chrisant996 / clink

Bash's powerful command line editing in cmd.exe
https://chrisant996.github.io/clink/
GNU General Public License v3.0
3.63k stars 143 forks source link

Can't type backslash in On-Screen Keyboard with Swedish keyboard layout #467

Closed chrisant996 closed 1 year ago

chrisant996 commented 1 year ago

Originally reported by @Sopor in https://github.com/cmderdev/cmder/issues/89#issuecomment-1595867584:

I can't type backslash, but i can copy it from another window and paste it in Cmder.

chrisant996 commented 1 year ago

Discussion revealed that the issue occurs when using the On-Screen Keyboard to input AltGr \ when using the Swedish keyboard layout.

chrisant996 commented 1 year ago

AltGr-\ from the physical keyboard says Left Ctrl and Right Alt are pressed.

AltGr \ from the On-Screen Keyboard says Left Ctrl, Left Alt, and Right Alt are pressed.

Those are the flags for the AltGr substitute being used. By default, Clink ignores the AltGr substitute, to avoid interfering with tons of key bindings.

Running clink set terminal.use_altgr_substitute true lets Clink respect the AltGr substitute, and then the OSK is able to input the \ character.

Hopefully there is a way for Clink to differentiate between a user entering the AltGr substitute versus the OSK generating a misleading AltGr substitute. Maybe Clink can consider Left Alt + Right Alt to mean that it isn't actually the AltGr substitute?