[Vm-dev] [Cog/Spur Unix x86] Some keyUp events missing...

marcel.taeumel Marcel.Taeumel at hpi.de
Wed Nov 18 16:07:00 UTC 2015


If you press two keys, you get two keyDown events. If you release them
simultaneously, you get only the second keyUp event.

I suspect the following code in sqUnixX11.c (line 3745 ff.) :

    case KeyRelease:
	KeySym symbolic;
	int keyCode, ucs4;
	if (XPending(stDisplay))
	    XEvent evt2;
	    XPeekEvent(stDisplay, &evt2);
	    if ((evt2.type == KeyPress) && (evt2.xkey.keycode == evt->xkey.keycode)
&& ((evt2.xkey.time - evt->xkey.time < 2)))
	keyCode= x2sqKey(&evt->xkey, &symbolic);
	ucs4= xkeysym2ucs4(symbolic);
	if ((keyCode >= 0) || (ucs4 > 0))
	  recordKeyboardEvent(keyCode, EventKeyUp, modifierState, ucs4);

There is that "XPending" check, which seems to swallow events. Looks like
hack. Not sure. There is no comment. :)

In our case, we hit both Arrow-Down and Arrow-Right, get two keyDown-events,
then release both, and get only keyUp for ArrowRight.

Who knows the CogVM unix sources? :)


View this message in context: http://forum.world.st/Cog-Spur-Unix-x86-Some-keyUp-events-missing-tp4861720.html
Sent from the Squeak VM mailing list archive at Nabble.com.

More information about the Vm-dev mailing list