54 case XI_RawKeyPress: {
55 auto re =
reinterpret_cast<xXIRawEvent *
>(
event);
59 case XI_RawKeyRelease: {
60 auto re =
reinterpret_cast<xXIRawEvent *
>(
event);
64 case XI_RawButtonPress: {
65 auto e =
reinterpret_cast<xXIRawEvent *
>(
event);
69 case XCB_BUTTON_INDEX_1:
72 case XCB_BUTTON_INDEX_2:
75 case XCB_BUTTON_INDEX_3:
78 case XCB_BUTTON_INDEX_4:
79 case XCB_BUTTON_INDEX_5:
86 m_x11Cursor->schedulePoll();
89 case XI_RawButtonRelease: {
90 auto e =
reinterpret_cast<xXIRawEvent *
>(
event);
94 case XCB_BUTTON_INDEX_1:
97 case XCB_BUTTON_INDEX_2:
100 case XCB_BUTTON_INDEX_3:
103 case XCB_BUTTON_INDEX_4:
106 case XCB_BUTTON_INDEX_5:
113 m_x11Cursor->schedulePoll();
116 case XI_TouchBegin: {
117 auto e =
reinterpret_cast<xXIDeviceEvent *
>(
event);
118 m_lastTouchPositions.insert(e->detail, QPointF(fixed1616ToReal(e->event_x), fixed1616ToReal(e->event_y)));
121 case XI_TouchUpdate: {
122 auto e =
reinterpret_cast<xXIDeviceEvent *
>(
event);
123 const QPointF touchPosition = QPointF(fixed1616ToReal(e->event_x), fixed1616ToReal(e->event_y));
124 if (e->detail == m_trackingTouchId) {
125 const auto last = m_lastTouchPositions.value(e->detail);
128 m_lastTouchPositions.insert(e->detail, touchPosition);
132 auto e =
reinterpret_cast<xXIDeviceEvent *
>(
event);
133 if (e->detail == m_trackingTouchId) {
136 m_lastTouchPositions.remove(e->detail);
137 m_trackingTouchId = 0;
140 case XI_TouchOwnership: {
141 auto e =
reinterpret_cast<xXITouchOwnershipEvent *
>(
event);
142 auto it = m_lastTouchPositions.constFind(e->touchid);
143 if (it == m_lastTouchPositions.constEnd()) {
144 XIAllowTouchEvents(display(), e->deviceid, e->sourceid, e->touchid, XIRejectTouch);
146 if (
workspace()->screenEdges()->gestureRecognizer()->startSwipeGesture(it.value()) > 0) {
147 m_trackingTouchId = e->touchid;
149 XIAllowTouchEvents(display(), e->deviceid, e->sourceid, e->touchid, m_trackingTouchId == e->touchid ? XIAcceptTouch : XIRejectTouch);
155 m_x11Cursor->schedulePoll();