|
38 | 38 | #include "viewporter-client-protocol.h" |
39 | 39 | #include "cursor-shape-client-protocol.h" |
40 | 40 | #include <xkbcommon/xkbcommon.h> |
41 | | -#include <linux/input-event-codes.h> |
42 | 41 |
|
43 | 42 | using namespace o2::gpu; |
44 | 43 |
|
@@ -95,7 +94,7 @@ int32_t GPUDisplayFrontendWayland::GetKey(uint32_t key, uint32_t state) |
95 | 94 | return (KEY_HOME); |
96 | 95 | } else if (sym == XKB_KEY_Insert) { |
97 | 96 | return (KEY_INSERT); |
98 | | - } else if (sym == XKB_KEY_F1) { // TODO: Fix F* keys not working |
| 97 | + } else if (sym == XKB_KEY_F1) { |
99 | 98 | return (KEY_F1); |
100 | 99 | } else if (sym == XKB_KEY_F2) { |
101 | 100 | return (KEY_F2); |
@@ -174,24 +173,8 @@ int32_t GPUDisplayFrontendWayland::FrontendMain() |
174 | 173 | }; |
175 | 174 | auto pointer_button = [](void* data, wl_pointer* wl_pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) { |
176 | 175 | GPUDisplayFrontendWayland* me = (GPUDisplayFrontendWayland*)data; |
177 | | - if (state == WL_POINTER_BUTTON_STATE_PRESSED) { |
178 | | - if (button == BTN_RIGHT) { |
179 | | - me->mMouseDnR = true; |
180 | | - } else if (button == BTN_LEFT) { |
181 | | - me->mMouseDn = true; |
182 | | - } else if (button == BTN_MIDDLE) { |
183 | | - me->mMouseDnM = true; |
184 | | - } |
185 | | - me->mMouseDnX = me->mMouseMvX; |
186 | | - me->mMouseDnY = me->mMouseMvY; |
187 | | - } else if (state == WL_POINTER_BUTTON_STATE_RELEASED) { |
188 | | - if (button == BTN_RIGHT) { |
189 | | - me->mMouseDnR = false; |
190 | | - } else if (button == BTN_LEFT) { |
191 | | - me->mMouseDn = false; |
192 | | - } else if (button == BTN_MIDDLE) { |
193 | | - me->mMouseDnM = false; |
194 | | - } |
| 176 | + if (state == WL_POINTER_BUTTON_STATE_PRESSED || state == WL_POINTER_BUTTON_STATE_RELEASED) { |
| 177 | + me->handlePointerButton(button, state == WL_POINTER_BUTTON_STATE_PRESSED); |
195 | 178 | } |
196 | 179 | }; |
197 | 180 | auto pointer_frame = [](void* data, wl_pointer* wl_pointer) { ((GPUDisplayFrontendWayland*)data)->applyScroll(); }; |
|
0 commit comments