Re: How to recognize the Function keys in C
- From: usenet@xxxxxxx
- Date: 31 Dec 2005 16:36:54 GMT
Broeisi <broeisito@xxxxxxxxx> wrote:
> I'm trying to write a console based program in C in Linux.
> I want to use the function keys in my program, but I don;t know how to
> let the C program know when for exmaple the F1 key is pressed.
>
> I want to be able to use all 12 Function keys in my program.
> Can someone help me maybe on this one?
>
> I guess that those function keys also have an ascii number.
> But so far I haven't seen none of the funtion keys in my ascii chart.
<Offtopic>
Depending on the terminal type, function keys usually generate a specific
sequence of characters, often starting with ESC (0x1b). For example, on my
terminal, the F1 key generates the string "\x1b\x5b\x31\x31\x7e"
Reading function keys is something very system- and OS-specific and is not
possible with only ANSI-C; you might want to ask this question in the
appropriate newsgroup that discusses programming on unix/linux. You also
might want to look into the 'curses' and/or 'termcap' libraries, which are
specially designed to handle keyboard and screen IO on unix systems.
--
:wq
^X^Cy^K^X^C^C^C^C
.
- Follow-Ups:
- Re: How to recognize the Function keys in C
- From: Gordon Burditt
- Re: How to recognize the Function keys in C
- References:
- How to recognize the Function keys in C
- From: Broeisi
- How to recognize the Function keys in C
- Prev by Date: How to recognize the Function keys in C
- Next by Date: Happy New Year and Merry Christmas!
- Previous by thread: How to recognize the Function keys in C
- Next by thread: Re: How to recognize the Function keys in C
- Index(es):
Relevant Pages
|