llandsmeer / inkvt

Experimental VT100 terminal emulator for Kobo e-readers
GNU General Public License v3.0
39 stars 5 forks source link

Special keys not registering in the HTTP input interface #21

Open nicolaslazo opened 2 years ago

nicolaslazo commented 2 years ago

Hi! I got a chance to test out your project a few days ago and I'm really excited about using my Kobo as a text editor for my Ubuntu laptop, I'm loving what I saw so far. I noticed in the README that you wanted to hear if anything broke so I'll report my experience:

I'm using a Kobo Clara HD (firmware ver. 4.31.19086) and I was able to build inkvt with the KOreader cross-compiling toolchain. I was able to SSH into Ubuntu by following these steps

  1. Telnet into my Kobo from Ubuntu to start inkvt. I made sure to remove --no-http from the startup script
  2. Access the HTTP input interface with my Android phone (Firefox ver. 97.2.0) and an OTG keyboard
  3. SSH into my Ubuntu laptop

Most key inputs work perfectly but I've noticed a few key situations when this isn't the case. ESC, tabs, Alt+something and Ctrl+something. These get registered by the phone OS and pressing tab unfocuses the input field so I'm assuming there's something in the JS code that isn't catching them properly.

I'm not familiar with the language but I'll still try to fix this myself, but if you have any suggestions please let me know your thoughts

llandsmeer commented 2 years ago

Hi nicolaslazo, great to hear that you find the project useful!

This is indeed (partially) a problem with the HTTP interface and the reason why I finally switched to the touchscreen interface. The browser wants to keep those shortcuts for itself, partly for ease of use, partly for security (to close a hanging tab). From within a desktop browser you can disable most shortcuts in the browser, but I'm not sure how that works on mobile. Still, then you're left with Ctrl-W (close tab) not working in chrome and firefox. You could try mapping some function keys to those shortcuts.

Source: https://stackoverflow.com/questions/21695682/is-it-possible-to-catch-ctrlw-shortcut-and-prevent-tab-closing