d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
647 stars 45 forks source link

add support for alt/meta instead of ctrl, and change default key mappings #12

Closed d99kris closed 4 years ago

d99kris commented 4 years ago

from issue #8

Change key mappings to use alt/meta as a default instead of control (control can interfere with use in screen/tmux - the only time control only is useful is when dealing with a real serial terminal the UTF8 support makes that unlikely) - also, change so enter is the default send message and shift-enter is the default insert a new line.

d99kris commented 4 years ago

Improved support for custom key bindings has been implemented. Alt/meta does not have a "pretty printable" platform-independent representation in the underlying ncurses, so I've just added capability to set key bindings using hex codes, and added a "key code" dump mode (enabled using CTRL-K) for users to see the hex codes in the log file.

So in order to use for example alt, one need to use this dump mode to determine the key codes of the desired key combinations, and then manually write them into the config file.

As for shift-enter, I also wanted this functionality initially, but ncurses does not differentiate between enter and shift-enter, so I cannot do anything about it at this point.

The README has been updated accordingly.

@alohawolf - please let me know if this can solve your problem, or if you have other suggestions. Thanks.

Bellavene commented 2 years ago

Oh, so it is possible. Didn't found this post before. But it doesn't work for me, CTRL+K does nothing.