Unified · Split
| @@ -265,10 +265,6 @@ static struct wl_keyboard_listener keyboard_listener = { · 264 unmodified lines | |||
| 265 | }; | 265 | }; |
| 266 | 266 | ||
| 267 | enum{ | 267 | enum{ |
| 268 | WlMouse1 = 272, | ||
| 269 | WlMouse2 = 274, | ||
| 270 | WlMouse3 = 273, | ||
| 271 | |||
| 272 | P9Mouse1 = 1, | 268 | P9Mouse1 = 1, |
| 273 | P9Mouse2 = 2, | 269 | P9Mouse2 = 2, |
| 274 | P9Mouse3 = 4, | 270 | P9Mouse3 = 4, |
| @@ -278,32 +274,20 @@ static void · 3 unmodified lines | |||
| 278 | pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) | 274 | pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) |
| 279 | { | 275 | { |
| 280 | Wlwin *wl; | 276 | Wlwin *wl; |
| 277 | int m; | ||
| 281 | 278 | ||
| 282 | wl = data; | 279 | wl = data; |
| 280 | switch(button){ | ||
| 281 | case BTN_LEFT: m = P9Mouse1; break; | ||
| 282 | case BTN_MIDDLE: m = P9Mouse2; break; | ||
| 283 | case BTN_RIGHT: m = P9Mouse3; break; | ||
| 284 | default: m = 0; break; | ||
| 285 | } | ||
| 286 | |||
| 283 | if(state) | 287 | if(state) |
| 284 | switch(button){ | 288 | wl->mouse.buttons |= m; |
| 285 | case WlMouse1: /* M1 */ | ||
| 286 | wl->mouse.buttons |= P9Mouse1; | ||
| 287 | break; | ||
| 288 | case WlMouse2: /* M2 */ | ||
| 289 | wl->mouse.buttons |= P9Mouse2; | ||
| 290 | break; | ||
| 291 | case WlMouse3: /* M3 */ | ||
| 292 | wl->mouse.buttons |= P9Mouse3; | ||
| 293 | break; | ||
| 294 | } | ||
| 295 | else | 289 | else |
| 296 | switch(button){ | 290 | wl->mouse.buttons &= ~m; |
| 297 | case WlMouse1: /* M1 */ | ||
| 298 | wl->mouse.buttons &= ~P9Mouse1; | ||
| 299 | break; | ||
| 300 | case WlMouse2: /* M2 */ | ||
| 301 | wl->mouse.buttons &= ~P9Mouse2; | ||
| 302 | break; | ||
| 303 | case WlMouse3: /* M3 */ | ||
| 304 | wl->mouse.buttons &= ~P9Mouse3; | ||
| 305 | break; | ||
| 306 | } | ||
| 307 | 291 | ||
| 308 | wl->mouse.msec = time; | 292 | wl->mouse.msec = time; |
| 309 | absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, wl->mouse.buttons, wl->mouse.msec); | 293 | absmousetrack(wl->mouse.xy.x, wl->mouse.xy.y, wl->mouse.buttons, wl->mouse.msec); |