dix: Extend IsKeyboardDevice() to not include pointer devices.

If a pointer devices has key classes as well, don't register it as a keyboard
device. Let's see how much that change will break.
This commit is contained in:
Peter Hutterer 2008-04-10 09:59:45 +09:30
parent cc7dab2d04
commit bce6091c6b
1 changed files with 4 additions and 1 deletions

View File

@ -331,11 +331,14 @@ IsPointerDevice(DeviceIntPtr dev)
/*
* Return true if a device is a keyboard, check is the same as used by XI to
* fill the 'use' field.
*
* Some pointer devices have keys as well (e.g. multimedia keys). Try to not
* count them as keyboard devices.
*/
_X_EXPORT Bool
IsKeyboardDevice(DeviceIntPtr dev)
{
return (dev->key && dev->kbdfeed);
return (dev->key && dev->kbdfeed) && !IsPointerDevice(dev);;
}
#ifdef XEVIE