/dev/kbd, keystroke access

Tom Christiansen tchrist at convex.COM
Wed Feb 20 11:29:33 AEST 1991


>From the keyboard of nieters at crd.ge.com:
:
:hi
:	i have been RTFM'ing for long enough!  time to post .... :-)

Did you consider RTFFAQ?

:the problem:
:	i want to write a program which will tell me if
:	a key has been pressed on the keyboard.  i don't want to 
:	intercept the key or modify it, i just want to catch the
:	"interrupt" and count it.  ideally a blocking ioctl() or
:	equivalent would be best but i can sit in a busy loop and
:	poll until i see a key stroke, increment a counter, and continue.


Unless you care whether they have hit a shift but no real character
has actually been answered, this is way too much work.

See the following FAQs (by question number) for further details:

    Group			Q#

    comp.unix.questions		 7
    comp.lang.c		 	64
    comp.lang.perl	 	16

--tom
--
Tom Christiansen		tchrist at convex.com	convex!tchrist
 "All things are possible, but not all expedient."  (in life, UNIX, and perl)



More information about the Comp.unix.programmer mailing list