Keyboard - mouse interface fail on linux install

Ian Piumarta ian.piumarta at inria.fr
Wed Jun 5 21:27:09 UTC 2002


On Wed, 5 Jun 2002, Lex Spoon wrote:
> 
> Hmm.  What happens in the "fixed" VM if you switch apps while a modifier
> key is down?  e.g., what happens if you alt-tab away from Squeak and
> then click to return?  Squeak might see the alt press, but it might lose
> focus before the alt key is released.  When you click back, the VM would
> still think the alt key is pressed.

You reset the modifier state, either to zero (on EnterNotify -- cheap
solution but relatively harmless) or to the correct state by inspecting
the contents of the KeymapEvent which accompanies it (expensive solution
but which does The Right Thing).

> More fundamentally, do all X servers even have key press event for
> modifiers?

I've never seen one that didn't.

> Do all X servers even have key release events at all?

It's part of the protocol.

> Also, what about things like caps lock -- shouldn't we handle those,
> as well?

XLookupString takes care of that.

> The "state" variable is there for a reason.  How far should we go if we
> can't rely on it?  Maybe these guys should fix their install if it is
> that messed up.

That was my initial reaction.  I was just trying to investigate
alternatives and not leave these guys stuck forever at an ancient version
(especially since they apparently have no problems with other apps on
Mandrake...).

The most perplexing thing is that this problem occurred immediately after
pulling in the SF patches (sound like a familiar story? ;^p).  I'm
starting to wonder about that MappingNotify -> XRefreshKeyboardMapping
that's in there, which I took on faith.  Maybe it would be a neat idea to
check if the event is even related to the keyboard at all before trying to
remap it.

(I asked Chris a few hours ago to remove this from his broken VM and try
it again.  I'm still waiting to hear from him.  But that still wouldn't
explain the weird stuff that xev was printing out for him.)

Ian





More information about the Squeak-dev mailing list