Re: keyboarding in C :)
- From: Grant Edwards <grante@xxxxxxxx>
- Date: Thu, 20 Apr 2006 19:16:08 -0000
On 2006-04-20, The Other Guy <tog@xxxxxxxxx> wrote:
I want to write simple app that do some thing acoording to which key was
pressed. It would be sth like this
case (code1) :
case (code2) :
The only problem is i know how to do it in windows (which structure holds
messages from keyboard) and i do not know how to do this in FreeBSD/UNIX.
I would be very happy if someone throw me a link to page that covers this
Are you simply wanting to do this from a command line tool, or are you
trying to handle keyboard input using one of the GUI toolkits etc?
For a command-line based application, you can just do this...
This is almost identical to what you'd do in Windows, except getchar()
would probably be replaced with getch(), depending on the compiler.
He may want to put the tty into raw mode in order to disable
Grant Edwards grante Yow! This is PLEASANT!