Ideas on improving powercomputing keyboard

Jerry Quinn jquinn at nortelnetworks.com
Wed Jul 28 01:52:15 EST 1999


Hi, all.  I'm finally annoyed enough by the 'a' chars generated by the caps
lock key on power computing keyboards under X to try to fix it.  In the
process, maybe it will be useful enough to actually swap it to be the control
key (as any good keyboard should be :-).

The situation on the powercomputing keyboard hardware is a bit braindead as
far as I can tell.  I used showkeys to give me the info on what is coming back 
from the keys.  So the first question is - can I trust the output of showkeys?

According to showkeys:

'a' down returns 0x00
'a' up returns 0x80

CapsLock down returns 0x39 or 0xb9
CapsLock up returns 0x80 !

Needless to say, this is ugly.  The keyboard seems pretty broken here.

Anyway, my thought is to play games with the return values of capslock based
on the state of the two keys.  Basically, if both keys are down, then when an
0x80 is seen, I will start by assuming that it is the 'a' that was released
and return 0x80.  I'm making the assumption that if someone presses both of
them together, the capslock is probably being used as a control key and the
user is more likely to release and repress the 'a' than the capslock key.

I have a 7-state state machine to represent what's going on.  The place where
trouble emerges is if both are down and the user really releases the capslock
(but we signal an 'a' release).  If the capslock is pressed again, the 'a' key 
is physically down but logically released.  I think the right thing to do is
to assume the next 0x80 is still an 'a' release, but swallow it in the
driver.

A second issue is that if we goof and the capslock is pressed again, do I
return another capslock press (two in a row) or swallow it?

A few other questions I have:

What is RAW mode?  When is raw mode versus non-raw used and should the
behavior I describe be any different in the two cases?  Does raw vs. non-raw
explain why 'a's appear when pressing capslock in X but not at the console?

Also, where is the best place to stick this code?  I see two logical places -
the kbd_translate() call and the scan code call (I don't have the file in
front of me so don't remember exact names).  

Anyone know if I'm going to trash the response of other keyboards by doing
this? 

Finally, there is a comment in the code (mac_kbd.c) from Anthony Tong about
emulating the PC keyboard capslock key by immediately sending caps up as soon
as it's pressed.  What is going on with this and how might it relate to what I 
want to do?

I know this is a lot of questions, but people with a better overall view of
how the keyboard code works will save me a lot of anguish and embarassment :-) 

Thanks,

Jerry

-- 
Jerry Quinn                             Tel: (514) 761-8737
jquinn at nortelnetworks.com               Fax: (514) 761-8505
Speech Recognition Research


[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]





More information about the Linuxppc-dev mailing list