Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numpad arrow keys #1881

Closed
rakslice opened this issue Jan 12, 2021 · 2 comments · Fixed by #1889
Closed

numpad arrow keys #1881

rakslice opened this issue Jan 12, 2021 · 2 comments · Fixed by #1889

Comments

@rakslice
Copy link
Contributor

rakslice commented Jan 12, 2021

Problem description

With a USB keyboard, the numpad arrow keys don't work as arrow keys in termux when numlock is off

In other places in the Android OS, for instance in the Settings app, the numpad works as expected (that is, the arrow keys move the selection around in the corresponding direction when num lock is off, and type the corresponding numbers when num lock is on)

Steps to reproduce

  1. Launch termux; an ordinary shell prompt comes up
  2. Connect an ordinary USB HID keyboard to the android device
  3. If the keyboard's num lock status light is on, press the num lock key until the num lock status light is off
  4. Press the numpad arrow keys.

Observed behaviour: the arrow keys on the numpad act as numbers whether or not num lock is on

Expected behavior

The arrow keys on the numpad act as arrow keys, for instance up and down navigate through the command history in bash

Additional information

  • Termux application version: 0.101, play store version
  • Android OS version: 9 (FireOS 7.3.1.7)
  • Device model: Amazon Fire HD 10 (2019 version)

For background:

These extra functions are typical on PC and similar keyboards with numeric keypads.
https://en.wikipedia.org/wiki/IBM_PC_keyboard#/media/File:Brazilian_104-key_ABNT2_keyboard.jpg
https://deskthority.net/wiki/images/8/8d/Suntype5.jpg

On the original layouts (e.g. IBM Model F, Sun Type 4) there is no separate arrow cluster; the only way to type an arrow is with the keypad:
https://deskthority.net/wiki/images/8/84/IBM_XT_top.JPG

@rakslice
Copy link
Contributor Author

When I press num lock, according to vtshowkeys it sends Esc O P (which is the code for PF1 on a vt100).
Termux appears to be hardcoded to do this:

@rakslice
Copy link
Contributor Author

rakslice commented Jan 15, 2021

Ah, I think I understand now:
PF1 on an actual DEC VT100 is physically located where num lock is on a PC keyboard.
https://en.wikipedia.org/wiki/VT100#/media/File:DEC_VT100_terminal.jpg
On a real VT100 the numpad is only for numbers, there is no need for num lock.

If being an emulation of using Linux with a real DEC VT100 terminal was the goal, you have succeeded.

The trouble is, Linux users show up expecting the keyboard to work like it does in Linux, where the "vt100" is:

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants