linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Caps lock XOR on multiple keyboards?
@ 2012-12-04  0:01 George Spelvin
  2012-12-04  5:33 ` Dmitry Torokhov
  0 siblings, 1 reply; 7+ messages in thread
From: George Spelvin @ 2012-12-04  0:01 UTC (permalink / raw)
  To: linux-input; +Cc: alan, chris, gregkh, jslaby, linux

(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...)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Caps lock XOR on multiple keyboards?
  2012-12-04  0:01 Caps lock XOR on multiple keyboards? George Spelvin
@ 2012-12-04  5:33 ` Dmitry Torokhov
  2012-12-04 10:26   ` George Spelvin
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2012-12-04  5:33 UTC (permalink / raw)
  To: George Spelvin; +Cc: linux-input, alan, chris, gregkh, jslaby

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Caps lock XOR on multiple keyboards?
  2012-12-04  5:33 ` Dmitry Torokhov
@ 2012-12-04 10:26   ` George Spelvin
  0 siblings, 0 replies; 7+ messages in thread
From: George Spelvin @ 2012-12-04 10:26 UTC (permalink / raw)
  To: dmitry.torokhov, linux; +Cc: alan, chris, gregkh, jslaby, linux-input

> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Caps lock XOR on multiple keyboards?
       [not found] ` <20121203235848.04228689@bob.linux.org.uk>
@ 2013-03-24 10:30   ` Pavel Machek
  2013-03-24 10:41     ` Pavel Machek
  2013-03-24 22:39     ` Samuel Thibault
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2013-03-24 10:30 UTC (permalink / raw)
  To: Alan Cox, linux-input, jkosina
  Cc: George Spelvin, chris, gregkh, jslaby, linux-kernel,
	samuel.thibault

Hi!
On Mon 2012-12-03 23:58:48, Alan Cox wrote:
> On 3 Dec 2012 16:19:11 -0500
> "George Spelvin" <linux@horizon.com> wrote:
> 
> > (Not sure who owns this; Cc: to the last few people to touch
> > drivers/tty/vt/keyboard.c.)
> 
> linux-input is probably the best place to discuss this

Added few more ccs. Yes, I see that too, in kernels such as debian
2.6.32. It may be even older than that, but I was not using docking
heavily in the old days.

Symptoms for me are that pretty often capslock LED will start show
opposite of true capslock state. I normally use X these days.

(Other problem seems to be that keyboard LEDs are not updated on
keyboard hotplug.)

There is patch to drive keyboard LEDs through LED subsystem, perhaps
that would be good idea?

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Caps lock XOR on multiple keyboards?
  2013-03-24 10:30   ` Pavel Machek
@ 2013-03-24 10:41     ` Pavel Machek
  2013-03-24 22:39     ` Samuel Thibault
  1 sibling, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2013-03-24 10:41 UTC (permalink / raw)
  To: Alan Cox, linux-input, jkosina
  Cc: George Spelvin, chris, gregkh, jslaby, linux-kernel,
	samuel.thibault

On Sun 2013-03-24 11:30:18, Pavel Machek wrote:
> Hi!
> On Mon 2012-12-03 23:58:48, Alan Cox wrote:
> > On 3 Dec 2012 16:19:11 -0500
> > "George Spelvin" <linux@horizon.com> wrote:
> > 
> > > (Not sure who owns this; Cc: to the last few people to touch
> > > drivers/tty/vt/keyboard.c.)
> > 
> > linux-input is probably the best place to discuss this
> 
> Added few more ccs. Yes, I see that too, in kernels such as debian
> 2.6.32. It may be even older than that, but I was not using docking
> heavily in the old days.
> 
> Symptoms for me are that pretty often capslock LED will start show
> opposite of true capslock state. I normally use X these days.

Ok... so it is:

Each capslock key only controls the local LED, but affects global
state.

So I turn on capslock on PS/2 keyboard its led is on. But I type on
USB keyboard, its capslock led is off, but I type in all caps. Oops.

								Pavel 
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Caps lock XOR on multiple keyboards?
  2013-03-24 10:30   ` Pavel Machek
  2013-03-24 10:41     ` Pavel Machek
@ 2013-03-24 22:39     ` Samuel Thibault
  2013-03-26 16:54       ` Peter Korsgaard
  1 sibling, 1 reply; 7+ messages in thread
From: Samuel Thibault @ 2013-03-24 22:39 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Alan Cox, linux-input, jkosina, George Spelvin, chris, gregkh,
	jslaby, linux-kernel

Hello,

I can confirm that things go fine on the Linux console.  There is just
one state, which is shown on all keyboards.  This is really a bug in
Xorg, please report the issue there.

Pavel Machek, le Sun 24 Mar 2013 11:30:18 +0100, a écrit :
> There is patch to drive keyboard LEDs through LED subsystem, perhaps
> that would be good idea?

My patch won't fix the issue for Xorg, but it'd still be a good thing to
at last apply it :)

Samuel
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Caps lock XOR on multiple keyboards?
  2013-03-24 22:39     ` Samuel Thibault
@ 2013-03-26 16:54       ` Peter Korsgaard
  0 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2013-03-26 16:54 UTC (permalink / raw)
  To: Samuel Thibault
  Cc: Pavel Machek, Alan Cox, linux-input, jkosina, George Spelvin,
	chris, gregkh, jslaby, linux-kernel

>>>>> "Samuel" == Samuel Thibault <samuel.thibault@ens-lyon.org> writes:

 Samuel> Pavel Machek, le Sun 24 Mar 2013 11:30:18 +0100, a écrit :
 >> There is patch to drive keyboard LEDs through LED subsystem, perhaps
 >> that would be good idea?

 Samuel> My patch won't fix the issue for Xorg, but it'd still be a good
 Samuel> thing to at last apply it :)

Agreed.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-26 16:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04  0:01 Caps lock XOR on multiple keyboards? George Spelvin
2012-12-04  5:33 ` Dmitry Torokhov
2012-12-04 10:26   ` George Spelvin
     [not found] <20121203211911.20156.qmail@science.horizon.com>
     [not found] ` <20121203235848.04228689@bob.linux.org.uk>
2013-03-24 10:30   ` Pavel Machek
2013-03-24 10:41     ` Pavel Machek
2013-03-24 22:39     ` Samuel Thibault
2013-03-26 16:54       ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).