holzschu / a-shell

A terminal for iOS, with multiple windows
BSD 3-Clause "New" or "Revised" License
2.63k stars 116 forks source link

Czech keyboard #32

Open honzapulpan opened 4 years ago

honzapulpan commented 4 years ago

Czech keyboard (probably others as well) has an option to write special characters with alt. For example alt+2 writes @. When I use external keyboard, these characters don’t work in a-shell. It looks like alt is used as standard shift key in this case.

holzschu commented 4 years ago

Interesting. I'll have a look. I think it could be related to the "use caps-lock as escape" option. Is the problem still there when you deactivate the option?

honzapulpan commented 4 years ago

Yes, the problem still exists when I deactivate the option.

Most of the special characters I use are at number keys. Alt+number writes number instead of special character. Except alt+1 and alt+5, which writes apostrophe. It is correct for alt+1, while alt+5 should write ~. And alt+9 writes [, while it should write {. Similar alt+0 writes ], while it should be }.

There is different behavior using iPython. Alt+1 writes apostrophe (correct), while alt+2,3 etc. writes nothing and down in status above keyboard bar “Repeat 2” (or 3...) is shown.

It isn’t a huge problem though, I still can use English keyboard :-)

holzschu commented 4 years ago

This is interesting. Without "escape as caps-lock", we use iOS default keyboard management. I did notice it had issues in French with "ç/Ç" (alt-c), but I hoped other languages would be spared.

The good news is, since I already added something for the French keyboard, it should be easy to expand it for other keyboards. Is this the right layout? https://cdn.shopify.com/s/files/1/0810/3669/files/mac-czech-keyboard_1024x1024.png?12659750357617424768

I think the behaviour in iPython is related how it manages shortcuts, bypassing the system shortcuts.

honzapulpan commented 4 years ago

Yes, this layout is correct. Doesn't show all the ALT or SHIFT-ALT characters (most of them I never used :-)

Here are the full layouts with SHIFT and ALT keys (screens from MacOS, but I checked and it's the same at iPad)

CZ layout:

cz_keyboard

with SHIFT:

cz_keyboard_SHIFT

with ALT:

cz_keyboard_ALT

with SHIFT+ALT:

cz_keyboard_SHIFT_ALT

Thanks a lot. And it's really not a big issue, if you don't want to fix it :-) I can imagine it may be lot of work.

holzschu commented 4 years ago

I've added it to the TODO list: https://github.com/holzschu/a-shell/projects/1 It's a long list, but I'll get to it.

cristeahub commented 4 years ago

One thing to note here is that in the newest iOS verison you can remap CAPS to ESC via the system settings for external keyboards. Maybe all the remapping done in the app can be removed.

The norwegian keyboard suffers greatly as it is right now. To type { one needs ALT+SHITFT+8. As it stands right now, that is not possible.

holzschu commented 4 years ago

The fix for Czech keyboards will be in Build 86, soon to be on TestFlight. During my tests, I found that left-alt and right-alt behaved differently, which was surprising.

@cristeahub do I understand correctly that there is a similar issue for Norwegian keyboards? On which keys, specifically? Now that I have specific treatment for 2 languages, adding a third is easier.

cristeahub commented 4 years ago

@cristeahub do I understand correctly that there is a similar issue for Norwegian keyboards? On which keys, specifically? Now that I have specific treatment for 2 languages, adding a third is easier.

There are two issues:

Here's the layout for reference: No modifier keys:

image

With shift:

image

With option:

image

With option+shift:

image
honzapulpan commented 4 years ago

Thank you @holzschu. I tested it at build 86 and Czech keyboard is working perfectly fine.

holzschu commented 4 years ago

@cristeahub: about Vim and alt-keys, at least on my keyboard, left-alt and right-alt behave differently: left-alt-c sends escape-C, right-alt-C sends "ç". Which is extremely weird, because I didn't think there was a difference between them. I'm looking into it. That is also the reason why alt-keys don't work.

Support for Norwegian keyboards is going to be in the next build (93).

holzschu commented 4 years ago

Hi, build 94 has a generic fix (alt-key should now work with all external keyboards). I removed the code specific to Czech, English or Norwegian keyboards. Please let me know if this doesn't work.

honzapulpan commented 4 years ago

Czech one works perfectly fine. Now also in ipython. Thanks!

cristeahub commented 4 years ago

This works great! Thanks a lot! :+1: