| 270 | } |
| 271 | |
| 272 | int sdlMouseButtonUpFilter(SDL_Event const *event) { |
| 273 | ASSERT(event->type == SDL_MOUSEBUTTONUP); |
| 274 | |
| 275 | const SDL_MouseButtonEvent *ev = &event->button; |
| 276 | t_mse_event mevt; |
| 277 | |
| 278 | if (ev->button == 1) { |
| 279 | DDIO_mouse_state.btn_mask &= (~MOUSE_LB); |
| 280 | DIM_buttons.up_count[0]++; |
| 281 | DIM_buttons.is_down[0] = false; |
| 282 | DIM_buttons.time_up[0] = timer_GetTime(); |
| 283 | mevt.btn = 0; |
| 284 | mevt.state = false; |
| 285 | MB_queue.send(mevt); |
| 286 | // mprintf(0, "MOUSE Button 0: Up\n"); |
| 287 | } |
| 288 | else if (ev->button == 2) { |
| 289 | DDIO_mouse_state.btn_mask &= (~MOUSE_RB); |
| 290 | DIM_buttons.up_count[1]++; |
| 291 | DIM_buttons.is_down[1] = false; |
| 292 | DIM_buttons.time_up[1] = timer_GetTime(); |
| 293 | mevt.btn = 1; |
| 294 | mevt.state = false; |
| 295 | MB_queue.send(mevt); |
| 296 | // mprintf(0, "MOUSE Button 1: Up\n"); |
| 297 | } |
| 298 | else if (ev->button == 3) { |
| 299 | DDIO_mouse_state.btn_mask &= (~MOUSE_CB); |
| 300 | DIM_buttons.up_count[2]++; |
| 301 | DIM_buttons.is_down[2] = false; |
| 302 | DIM_buttons.time_up[2] = timer_GetTime(); |
| 303 | mevt.btn = 2; |
| 304 | mevt.state = false; |
| 305 | MB_queue.send(mevt); |
| 306 | // mprintf(0, "MOUSE Button 2: Up\n"); |
| 307 | |
| 308 | } |
| 309 | |
| 310 | // buttons 4 and 5 are reserved for the mouse wheel...that's how the engine works...adjust in here. |
| 311 | |
| 312 | else if (ev->button == 4) { |
| 313 | DDIO_mouse_state.btn_mask &= (~MOUSE_B6); |
| 314 | DIM_buttons.up_count[5]++; |
| 315 | DIM_buttons.is_down[5] = false; |
| 316 | DIM_buttons.time_up[5] = timer_GetTime(); |
| 317 | mevt.btn = 5; |
| 318 | mevt.state = false; |
| 319 | MB_queue.send(mevt); |
| 320 | // mprintf(0, "MOUSE Button 5: Up\n"); |
| 321 | } |
| 322 | else if (ev->button == 5) { |
| 323 | DDIO_mouse_state.btn_mask &= (~MOUSE_B7); |
| 324 | DIM_buttons.up_count[6]++; |
| 325 | DIM_buttons.is_down[6] = false; |
| 326 | DIM_buttons.time_up[6] = timer_GetTime(); |
| 327 | mevt.btn = 6; |
| 328 | mevt.state = false; |
| 329 | MB_queue.send(mevt); |
no test coverage detected