this should be simple

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Tue Jan 18 20:44:25 UTC 2005



On Tue, 18 Jan 2005, bob wrote:

> Suppose I want to write a very simple Linux C program to detect that the user
> has pressed CTRL (or ALT) and PGUP.
>
> How do I do this?
>
> I remember back to my QNX days that there were term functions which could
> detect this but for the life of me I can't find the Linux equivalent.

You put stdin into raw mode and then you have access to all keypresses. 
It is domcumented in Stevens 'Advanced Programming for in the UNIX 
Environment'. You can also 'peek' at setup code in the source of any 
console mode text editor, mail reader, top etc etc

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list