Re: How to recognize the Function keys in C



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
.



Relevant Pages

  • Re: How to recognize the Function keys in C
    ... > I'm trying to write a console based program in C in Linux. ... > I want to be able to use all 12 Function keys in my program. ... > But so far I haven't seen none of the funtion keys in my ascii chart. ...
    (comp.lang.c)
  • How to recognize the Function keys in C
    ... I'm trying to write a console based program in C in Linux. ... I want to be able to use all 12 Function keys in my program. ... But so far I haven't seen none of the funtion keys in my ascii chart. ...
    (comp.lang.c)
  • Re: Unable to install Fedora Core 2
    ... what I meant by the function keys is that the original menu is ... When I run the installation program, ... >> and the linux prompt. ... >> can hit a function key and see the possible options. ...
    (Fedora)
  • Re: Virtual PC 7 Question...
    ... > violating any group policies. ... I am installing Red Hat Linux 9. ... that your friend has a laptop, ... If you want normal PC function keys in Virtual PC, ...
    (comp.sys.mac.system)
  • Re: Getting a good termcap emulation on linux to emulate a sco console
    ... I've used Multiview in the past and it seems to work well under Linux. ... emulation when talking to the SCO Machine from windows box using say TERM. ... This would give me function keys and Color support and I was quite happy. ... screen display and functon keys working right on the linux machine as yet. ...
    (comp.unix.sco.misc)