Detecting meta (special) keys (Ctrl, Shift, Alt, Tab, Esc, Backspace) from Shell input

I want to know if anyone knows how to detect the meta (special) keys ( Ctrl, Shift, Alt, Tab, Esc, Backspace) of Shell input.

I saw messages that explain how to detect arrow keys, etc., but not the special keys mentioned above.
Is there a way I can do $ showkey -sand use the raw scan code to somehow get the key input?

Any help would be greatly appreciated!

+5
source share
2 answers

In general, you cannot do this. Nonetheless:

  • X11 KeyPress KeyRelease.
  • Linux ioctls, , console_ioctl(4). RAW MEDIUMRAW ( termios, ).
+3

, . tty - ( - ). , (, C, ncurses readline), dialog!

+2

All Articles