paul-nameless / tg

terminal telegram client
The Unlicense
943 stars 75 forks source link

Not only-latin keybindings support. #230

Open VolkovIlia opened 3 years ago

VolkovIlia commented 3 years ago

Is it any opportunity to add any other layout for keybindings? For example "hjkl" = "ролд"?

paul-nameless commented 3 years ago

That's something that I wanted to add for a long time. But for now don't know how to do it correctly. My experiments failed to work reliably.

VolkovIlia commented 3 years ago

I'am not a programmer but can give you some ideas: 1) Mb it is simple to add opportunity for binding keys for pushing other keys: example bind л push k 2) As I assume the main language of this project is python, mb its is useful to ask guys from this project https://aur.archlinux.org/packages/qutebrowser-not-only-latin-git/ for advice.

Just ideas. Hope this feature will be in your soft, soon!:)

TruncatedDinoSour commented 2 years ago

That's something that I wanted to add for a long time. But for now don't know how to do it correctly. My experiments failed to work reliably.

Even though a bad solution, I'm thinking maybe grab the input key, check ordinal (ord()) of the character and then check in the handler which action to do?

>>> user_input = "π"  # for example pressed π
>>> ord(user_input)
960
>>> # and then do stuff accordingly
>>>

for multiple keybinds (like ng) maybe they should be hashed and the hex number converted into a number instead of taking an ordinal?