Caps lock XOR on multiple keyboards?

3 messages, 2 authors, 2012-12-04 · open the first message on its own page

Caps lock XOR on multiple keyboards?

From: George Spelvin <hidden>
Date: 2012-12-04 00:01:03

(Moving to linux-input.)

I happen to have both a PS/2 and USB keyboard plugged, in, but was
noticing that the caps lock key seemed inverted.  When the LED was off,
I got all caps (unless I used shift), while when it was on I got normal
lower-case letters.

This quite confused me, until I looked over and saw that someone had
hit caps lock on the PS/2.

Experimenting, it seems that each keyboard has its own caps lock LED
state, and the XOR of the two controls the case of the letters.

The corresponding shift keys have a shared logical state which depends
on who last had a transition.  Holding down left-shift on one can be
cancelled by pressing and releasing left-shift on the other.  (But
left & right shift are tracked separately.)

It would make more sense if each keyboard's caps lock LED controlled
the effect on its keys.  Either give each keyboard a completely separate
caps lock state, or toggle both LEDs when either caps lock is pressed.

Perhaps the answer is "It's too much work to fix; stop doing something
so stupid", but I thought I'd at least mention it.

(Er... it appears that my XOR description was incomplete.  I now have
the keyboard system in a state where *one* caps lock LED has to be on
to get normal lower-case letters.  I was playing with down1/down2/up1/up2
combinations, but I'm not quite sure what happened...)

Re: Caps lock XOR on multiple keyboards?

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2012-12-04 05:33:39

Hi George,

On Monday, December 03, 2012 07:01:01 PM George Spelvin wrote:
(Moving to linux-input.)

I happen to have both a PS/2 and USB keyboard plugged, in, but was
noticing that the caps lock key seemed inverted.  When the LED was off,
I got all caps (unless I used shift), while when it was on I got normal
lower-case letters.

This quite confused me, until I looked over and saw that someone had
hit caps lock on the PS/2.

Experimenting, it seems that each keyboard has its own caps lock LED
state, and the XOR of the two controls the case of the letters.

The corresponding shift keys have a shared logical state which depends
on who last had a transition.  Holding down left-shift on one can be
cancelled by pressing and releasing left-shift on the other.  (But
left & right shift are tracked separately.)

It would make more sense if each keyboard's caps lock LED controlled
the effect on its keys.
LEDs do not control state, state should control LEDs.
Either give each keyboard a completely separate
caps lock state, or toggle both LEDs when either caps lock is pressed.
When in console (i.e. not X) then all keyboard's LEDs and state should be 
synced together. I.e. when pressing CapsLock on one keyboard both keyboards 
CapsLock LEDs should come on or off and the register should be the same.

This is known to be broken in X (and should be reported [again] there) but
if you can provide scenario to break it in VT I'd love to know it.
Perhaps the answer is "It's too much work to fix; stop doing something
so stupid", but I thought I'd at least mention it.
No, it is not stupid at all.

Thanks.

-- 
Dmitrys

Re: Caps lock XOR on multiple keyboards?

From: George Spelvin <hidden>
Date: 2012-12-04 10:26:04

This is known to be broken in X (and should be reported [again] there) but
if you can provide scenario to break it in VT I'd love to know it.
Ding ding ding, you win the prize!  Yes, I was in X at the time.
Me dumbshit; I should have realized that this was relevant and mentioned
it.  My apologies.

The bad part is now I have to figure out which layer of what
to point the finger at.  :-(

Sorry for the noise.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help