d99kris / nchat

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

Remapping up/down #132

Closed amiroslaw closed 9 months ago

amiroslaw commented 9 months ago

Description: I want to remap selecting message, but I lose ability to selecting contacts in address book and contact selector.

What I see there are no separates actions for moving through messages and items in address book/contact selector only up and down bindings.

How to reproduce it: Change keybindings delete_line_after_cursor=\33\153 down=KEY_CTRLJ up=KEY_CTRLK Open adreess book or select_contact - c-j/c-k do nothing.

Environment:

d99kris commented 9 months ago

Hi @amiroslaw - some ctrl-keys are not ideal to use as keybindings in the terminal due to having same effect as other common keys, for example: KEY_CTRLJ same asKEY_ENTER KEY_CTRLH same as KEY_BACKSPACE

Anyway, you should be able to use for example:

down=KEY_CTRLG
up=KEY_CTRLK

And to be on the safe side, ensure no other functions are using the same keys, i.e. change:

delete_line_after_cursor=KEY_CTRLK
toggle_help=KEY_CTRLG

to

delete_line_after_cursor=
toggle_help=

This works for me, tested on latest v3.79. I'll proceed to close this issue, but feel free to re-open it if you're still facing problems.