terrychou / iVim

A vim port to iOS.
598 stars 35 forks source link

Magic keyboard layout (Swedish) not honoured #217

Closed KlasO closed 2 years ago

KlasO commented 2 years ago

Keypresses on a Magic Keyboard with Swedish layout does not produce the expected characters. It seems that iVim is set to US keyboard layout.

terrychou commented 2 years ago

The key repeating feature in iVim currently only supports English keyboards and it is turned on by default (":h ios-settings"). Please turn it off to see whether it helps.

KlasO commented 2 years ago

I have not observed any issue with key repeat - the issue is that the symbols on screen don't match the symbols on the keys, e.g. <>[] and so forth. These symbols are found on different keys than on the US keyboard layout.

terrychou commented 2 years ago

Rather than saying that you have problem with the key repeating, what I meant was that this might have something to do with iVim's implementation of key repeating. So it would be helpful if you can turn off key repeating in iVim to test my guess.

KlasO commented 2 years ago

Thanks for the clarification. Switching off key repeat does indeed help, now the keypresses result in the expected signs on screen.

terrychou commented 2 years ago

Great to know this! The current implementation of key repeating in iVim needs to hardcode some key pressings, which looks like the cause of this issue. I will think about a better solution of this part.

terrychou commented 2 years ago

I have added a new function that tries to detect and configure the hardware keyboard automatically. Would you like to help and give it a test? If yes, please leave me an email and I will send you a TestFlight invitation.

KlasO commented 2 years ago

Email sent, sorry for dragging my feet.

terrychou commented 2 years ago

The version 2.44 is now available on App Store.

KlasO commented 2 years ago

This issue has reappeared in 2.45(4), and I can no longer change the keyboard to sv-SE. I reports en.-US when I :echo g:ivim_kbd_primary_language

terrychou commented 2 years ago

Could you paste the content of file "~/.vim/ivim_hardware_keyboard_config.json" here?

KlasO commented 2 years ago

{ "sv-SE" : { "mappings" : { "S-à" : "À", "S-ä" : "Ä", "S-ö" : "Ö", "S-å" : "Å", "S-é" : "É" }, "symbols" : "-=~!@#$%^&*()_+[]\\{}|;':\",.\/<>?", "letters" : "abcdefghijklmnopqrstuvwxyzàäåéö", "version" : "0.0.1" }, "en-US" : { "mappings" : { "S-à" : "À", "S-ä" : "Ä", "S-ö" : "Ö", "S-å" : "Å", "S-é" : "É" }, "symbols" : "-=~!@#$%^&*()_+[]\{}|;':\",.\/<>?", "letters" : "abcdefghijklmnopqrstuvwxyzàäåéö", "version" : "0.0.1" } }

terrychou commented 2 years ago

The config looks OK here.

By "This issue has reappeared", do you mean "some Swedish keys are recognized incorrectly", or "some keys not repeating"?

Have you tried and:

1) reconnected the hardware keyboard? 2) rebooted the device?

KlasO commented 2 years ago

Not sure what happened, but I was stuck with an en-US keyboard and could not change it. Now it works again; I did reboot the iPad and remove and reattach the keyboard.