xf86Info.pkeyboard->key is a pointer to KeyClassRec;
This has a slot 'down', a bitmap of what keyboard keys are down.
Now, the key (and other input devices) events handling can be divided into 2
parts, which communicate via a fixed-length vector xf86EventQueue.
The lower part
==============
reads from keyboard device/file, makes some transformations
_consults_ the down bits and either puts the event in the vector, or drops the
event in this case:
The event is a Press, but the bit indicates, that the key is already down,
and we use software key-repetition (provided by XKB).
the lower part does _not_ modify this bitmap.
The upper part
===============
reads from the fixed-lenght vector, and either processes the keyevent (sending
it to clients), and updates the down bits,
or
in case of 'frozen' device (i.e. sync grab), enqueues (function EnqueueEvent)
the event into a queue in variable syncEvents. In this case the bits are not
changed till XAllowEvents, or XUngrabKeyboard.
How to obtain a buggy behaviour:
================================
Let's say i have a sync passive grab on hyper-control-m:
if i press: Press-hyper Press-control Press-m {now grab starts, and i issue an
explicit sync grab} Release-m Release-control Release-hyper Press-Control
Press-d
If the grab is still on when i press the 2nd time Control, that keypress will be
dropped (despite following a Release-control), therefore no event is put to the
fixed-lenght vector, i.e. the upper part will not get it.
All of this because the 'down' bitmap has not been updated since the 'm' event
(which triggered the keyboard freeze), and at that moment control was down.
Solution:
=========
Since i don't know exactly why is the 'down' bitmap needed in the upper part
(XKB), my quick solution is to make a new bit array hwdown, which is _updated_
and
consulted by the lower part.
And on VT switching, the bit array needs resetting.
the patch is included in http://bugs.xfree86.org/show_bug.cgi?id=1529
_______________________________________________
Devel mailing list
[email protected]
http://XFree86.Org/mailman/listinfo/devel