Changeset View
Changeset View
Standalone View
Standalone View
pointer_input.cpp
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 62 | static const QHash<uint32_t, Qt::MouseButton> s_buttonToQtMouseButton = { | |||
---|---|---|---|---|---|
76 | { 0x11a , Qt::ExtraButton8 }, | 76 | { 0x11a , Qt::ExtraButton8 }, | ||
77 | { 0x11b , Qt::ExtraButton9 }, | 77 | { 0x11b , Qt::ExtraButton9 }, | ||
78 | { 0x11c , Qt::ExtraButton10 }, | 78 | { 0x11c , Qt::ExtraButton10 }, | ||
79 | { 0x11d , Qt::ExtraButton11 }, | 79 | { 0x11d , Qt::ExtraButton11 }, | ||
80 | { 0x11e , Qt::ExtraButton12 }, | 80 | { 0x11e , Qt::ExtraButton12 }, | ||
81 | { 0x11f , Qt::ExtraButton13 }, | 81 | { 0x11f , Qt::ExtraButton13 }, | ||
82 | }; | 82 | }; | ||
83 | 83 | | |||
84 | uint32_t qtMouseButtonToButton(Qt::MouseButton button) | ||||
85 | { | ||||
86 | return s_buttonToQtMouseButton.key(button); | ||||
87 | } | ||||
88 | | ||||
84 | static Qt::MouseButton buttonToQtMouseButton(uint32_t button) | 89 | static Qt::MouseButton buttonToQtMouseButton(uint32_t button) | ||
85 | { | 90 | { | ||
86 | // all other values get mapped to ExtraButton24 | 91 | // all other values get mapped to ExtraButton24 | ||
87 | // this is actually incorrect but doesn't matter in our usage | 92 | // this is actually incorrect but doesn't matter in our usage | ||
88 | // KWin internally doesn't use these high extra buttons anyway | 93 | // KWin internally doesn't use these high extra buttons anyway | ||
89 | // it's only needed for recognizing whether buttons are pressed | 94 | // it's only needed for recognizing whether buttons are pressed | ||
90 | // if multiple buttons are mapped to the value the evaluation whether | 95 | // if multiple buttons are mapped to the value the evaluation whether | ||
91 | // buttons are pressed is correct and that's all we care about. | 96 | // buttons are pressed is correct and that's all we care about. | ||
92 | return s_buttonToQtMouseButton.value(button, Qt::ExtraButton24); | 97 | return s_buttonToQtMouseButton.value(button, Qt::ExtraButton24); | ||
93 | } | 98 | } | ||
94 | } | | |||
95 | 99 | | |||
96 | static bool screenContainsPos(const QPointF &pos) | 100 | static bool screenContainsPos(const QPointF &pos) | ||
romangg: Forgot to remove? | |||||
97 | { | 101 | { | ||
98 | for (int i = 0; i < screens()->count(); ++i) { | 102 | for (int i = 0; i < screens()->count(); ++i) { | ||
99 | if (screens()->geometry(i).contains(pos.toPoint())) { | 103 | if (screens()->geometry(i).contains(pos.toPoint())) { | ||
100 | return true; | 104 | return true; | ||
101 | } | 105 | } | ||
102 | } | 106 | } | ||
103 | return false; | 107 | return false; | ||
104 | } | 108 | } | ||
▲ Show 20 Lines • Show All 1292 Lines • Show Last 20 Lines |
Forgot to remove?