public void OnEvent(XIEvent *xev) { if (xev->evtype == XiEventType.XI_DeviceChanged) { var changed = (XIDeviceChangedEvent *)xev; _pointerDevice.Update(changed->Classes, changed->NumClasses); } //TODO: this should only be used for non-touch devices if (xev->evtype >= XiEventType.XI_ButtonPress && xev->evtype <= XiEventType.XI_Motion) { var dev = (XIDeviceEvent *)xev; if (_clients.TryGetValue(dev->EventWindow, out var client)) { OnDeviceEvent(client, new ParsedDeviceEvent(dev)); } } }
public void OnEvent(XIEvent *xev) { if (xev->evtype == XiEventType.XI_DeviceChanged) { var changed = (XIDeviceChangedEvent *)xev; _pointerDevice.Update(changed->Classes, changed->NumClasses); } if ((xev->evtype >= XiEventType.XI_ButtonPress && xev->evtype <= XiEventType.XI_Motion) || (xev->evtype >= XiEventType.XI_TouchBegin && xev->evtype <= XiEventType.XI_TouchEnd)) { var dev = (XIDeviceEvent *)xev; if (_clients.TryGetValue(dev->EventWindow, out var client)) { OnDeviceEvent(client, new ParsedDeviceEvent(dev)); } } }