this should be simple
Peter L. Peres
plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Wed Jan 19 10:05:06 UTC 2005
On Tue, 18 Jan 2005, Henry Spencer wrote:
> On Tue, 18 Jan 2005, Peter L. Peres wrote:
>>> 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.
>
> No, unfortunately, you have (immediate) access to all *characters* that
> way. This doesn't help for someone who wants to attach special
> significance to combinations of keypresses that don't correspond to
> distinct characters. That requires removing another level of abstraction,
> and the facilities for that are not well standardized, partly because in a
> lot of pre-PC systems, that level was in hardware and couldn't be removed.
Maybe I did not express myself clearly, I meant put stdin in raw mode
using ioctls. I have done this 'by the book' (Stevens) and later
otherwise, so I know what's involved. It is not a painful process
(compared to other programming issues imho). I agree about lack of
standards. Stevens describes a method that will not work on Linux
without peeking at the sources of an already running program (I think I
used the top source for this at the time). Some 'small details' are
different. I will try it out on netbsd later just to see how it
compares.
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