Question regarding XSetModifierMapping() with modifier down

Daniel Stone daniel at
Tue Jun 17 09:28:48 PDT 2008

On Tue, Jun 17, 2008 at 09:04:00AM -0700, Vinay Reddy wrote:
> If XSetModifierMapping() is called with one of the modifiers down, it
> returns MappingBusy, so we send a fake button up event through
> XTestFakeKeyEvent() for all modifiers that are down before calling
> XSetModifierMapping(). Although this worked well until recently, it
> doesn't seem to be working on newer XServers (at least on I
> added some logging to the Xserver, and found that
> AllModifierKeysAreUp() returns FALSE when it is called the second time
> in DoSetModifierMapping() (in xserver/dix/devices.c). Also, multiple
> bits seem to be on in KeyCode *inputMap of DoSetModifierMapping()
> (although only one modifier is pressed on the keyboard).
> Does anyone know if anything changed in the Xserver recently that
> could cause this? Are there any workarounds for this? I'd appreciate
> any pointers or help.

You need to fake an extended event for the device with its modifier held
down, as well as the virtual core keyboard.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <>

More information about the xorg mailing list