Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

According to this question tty only recognize character input and the rest of function keys F[1-12] as a char sequence.

I have a CUI application runs over wineconsole and expects a F12 key press, all is executed on tty session (ctrl+alt+f[1-6]). Now I can send the expected char sequence for the F12 using ctrl+[ [24~ or esc [24~ but that would be counter-intuitive and less memorable to send a function key using their char sequence.

So my question: is there any way that I can bind or config the tty terminal to recognize an F12 keypress (and the rest of the function keys) as ... well as an F12.

here is the output of my F12 keypress using showkey command in tty terminal

kb mode was UNICODE
[ if you are trying this under X, it might not work since the X server is also reading /dev/console ]

press any key (program terminates 10s after last keypress)...
keycode  28 release
keycode  88 press
keycode  88 release

and here is the output of the tput

F1 ^[[[A
F2 ^[[[B
F3 ^[[[C
F4 ^[[[D
F5 ^[[[E
F6 ^[[17~
F7 ^[[18~
F8 ^[[19~
F9 ^[[20~
F10 ^[[21~
F11 ^[[23~
F12 ^[[24~

Thanks in advance

share|improve this question
up vote 1 down vote accepted

My bad, it seems the problem is with the wineconsole not the terminal itself. The terminal accepted the keystroke all right but it seems not being recognized by the CUI application running in curses mode.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.