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

bindings in non english layout #55

Closed
wants to merge 2 commits into from
Closed

bindings in non english layout #55

wants to merge 2 commits into from

Conversation

liaonau
Copy link
Contributor

@liaonau liaonau commented Feb 6, 2012

This will allow to use binds in non English (Latin, in general) keyboard layout like Cyrillic.
Now when I'm on Cyrillic layout I have to switch to English, use bingings and switch again. Otherwise I'll get for example «:щ» not «:o» in command line.

@mason-larobina
Copy link
Member

Thanks for the patch, hope you don't mind a few questions about non-English layouts before applying it.

I assume this will mess with people using xmodmap? In that case I don't think those particular users would like this to be the default behaviour.

And in the pull request description you use the example case of in the input bar but as we don't use the keysyms in the key press/release signals to append or insert characters into the input entry widget directly this patch wouldn't do much. You'll still have to change to an english layout to type commands.

Also there was a patch applied months ago which allows unicode characters to be used in bindings. However I don't think that's a practical solution for all non-English users.

Perhaps we should give the user both keysyms in the key press/release signals. Then a simple config option (or automatic detection depending on the users locale) could change the matching behaviour without having to recompile luakit.

Just some ideas.

@liaonau
Copy link
Contributor Author

liaonau commented Feb 22, 2012

And in the pull request description you use the example case of :щ in the input bar but as we don't use the keysyms in the key press/release signals to append or insert characters into the input entry widget directly this patch wouldn't do much. You'll still have to change to an english layout to type commands.

I'm sorry, it was wrong example. I will get «щ» in statusbar instead of «:o» in the entry. I know luakit does not handle input in the entry. Another example: «пв» in buffer instead of «gd» and navigation to luakit://downloads.

I assume this will mess with people using xmodmap? In that case I don't think those particular users would like this to be the default behaviour.

38 0x0061 (a) 0x0041 (A) 0x06c6 (Cyrillic_ef) 0x06e6 (Cyrillic_EF)
It is removement of Mode_switch modifier in terms of xmodmap. «Cyrillic_ef» will be «a» and «Cyrillic_EF» will be «A».
I think most people expect key to perform one function despite current keyboard layout (which is group in keyboard's core protocol). Oh, yes. I've just realized that translation by hardware_keycode is a very bad idea in case of layouts like "us,dvorak" when the sets of keyvals are the same.

Also there was a patch applied months ago which allows unicode characters to be used in bindings. However I don't think that's a practical solution for all non-English users.

It means that one have to duplicate all «key» and «buf» calls in config/binds.lua, and edit all lib/*.lua files (bookmarks.lua for example) which add new keybindings. Just imagine that one have three layouts!
By the way. In lousy/bind.lua mods = filter_mods(mods, #key == 1), -- Remove Shift key for char keys
is wrong due to length of unicode chars. I can't bind capital Cyrillic letters like «Ф» using key({}, "Ф", …). Shift modifier is not removed.

Perhaps we should give the user both keysyms in the key press/release signals. Then a simple config option (or automatic detection depending on the users locale) could change the matching behaviour without having to recompile luakit.

Yes, it's a good idea. Maybe something like this https://github.com/liaonau/luakit/commit/9726209b9f8669aab5bc7237fb8d760babc90dc2

@liaonau liaonau closed this Aug 4, 2014
@liaonau liaonau deleted the keyboard_layout branch August 4, 2014 13:29
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 this pull request may close these issues.

None yet

2 participants