flyingrhinonz / nccm

GNU General Public License v3.0
133 stars 23 forks source link

Can't backspace in Filter field #7

Closed Justinzobel closed 3 years ago

Justinzobel commented 3 years ago

I have to quit and restart to clear the field.

Version 1.3.10

flyingrhinonz commented 3 years ago
  1. Did this work for you in an earlier version? I haven't touched the filter code in a long time and it always works for me.
  2. Can you backspace in the conn field?
  3. Have you got a non USA keyboard layout? Not sure this is related but I've only used USA keyboards so maybe your keyboard is sending a different code for backspace? This is easy enough to test - just run "nccm -d" then type something and backspace and look at syslog. I get this log on backspace - Keyboard entry UserKey = 263
Justinzobel commented 3 years ago

I've only just started using nccm again (used very long ago) after finding myself in need of an SSH Manager due to a new job.

I assume by syslog you mean systemd's journal?

Apr 13 18:44:11 justin-desktop nccm[596697]: (2021-04-13 18:44:10.507 , PN: MainProcess , MN: nccm , FN: MainCursesFunction , LI: 1552 , TN: MainThread): Keyboard entry UserKey = 17

I guess that's the one you're looking for. My keyboard layout in KDE is English Australian (AU).

Justinzobel commented 3 years ago

Conn field is the same.

flyingrhinonz commented 3 years ago

syslog / journalctl - same :)

It says here that backspace is unreliable - https://docs.python.org/3/library/curses.html Which proves what you are experiencing. More so that Filter and Conn behave the same.

For me ctrl-q gives code 17 !

What code does ctrl-h give you? I get 8 and it opens the man page.

If keyboard localization is causing these issues then I could add config file items to remap the keyboard but I prefer to look around and hopefully find a more elegant solution.

You said you used nccm a long time ago - do you remember if you also had AU keyboard or USA keyboard layout? I suspect you had USA because I never changed the control codes which is why you didn't experience this problem in the past.

Justinzobel commented 3 years ago

Quite possible I would have picked US keyboard layout in the past. I don't actually think there's any difference to be honest.

I think I may have gotten my output wrong before. Backspace: 127 Help Ctrl+H: 263 Quit Ctrl+Q: 17

flyingrhinonz commented 3 years ago

There is a difference between the codes you get and the ones I get. Let me check if there is an existing solution to this with ncurses or a python module, otherwise I can always made a keyboard shortcut map in the config file. I'm sure this will benefit EU users too because they have even weirder keyboards than us.

flyingrhinonz commented 3 years ago

I created a full mapping of all keyboard codes used in nccm - this is stored in nccm.yml . Testing for a few days and will push when ready. This version BREAKS COMPATIBILITY with older nccm.yml and the old files must be updated to the new version.