nanogui: Really raw keyboard?
Subject:
Re: Really raw keyboard?
From:
"Greg Haerr" ####@####.####
Date:
20 Feb 2001 16:07:17 -0000
Message-Id: <007a01c09b57$9b9ea7a0$15320cd0@gregh>
: Is there any possibility to switch OFF the autorepetition mode in the
: keyboard driver in nano-X (Linux)?
:
: In our application we need to detect whether more than one keys are
: pressed at once.
A far easier mechanism than what Jordan described will work:
Just change the drivers/kbd_ttyscan.c driver to ignore repeat
keypresses that don't change the keyboard state. If you look
at kbd_ttyscan.c, line 347, you will find an #if 0. Change it to
#if 1 and you're in business.
if (key_state[mwkey] == pressed)
return;
This code will toss all repeat keystrokes for the same
key.
A quick way of reading the keystate completely will be to
pass the key_state array back to the application. You'll have
to add another API for this, but that will remove having to have
your application process all this stuff all over again.
Regards,
Greg