Browse code

emu: use SDL_BUTTON macro to get bitmask from a mouse button event

Sigrid Solveig Haflínudóttir authored on 29/12/2021 17:47:54
Showing 1 changed files
... ...
@@ -451,9 +451,9 @@ run(Uxn *u)
451 451
 					clamp(event.motion.x - PAD, 0, uxn_screen.width - 1),
452 452
 					clamp(event.motion.y - PAD, 0, uxn_screen.height - 1));
453 453
 			else if(event.type == SDL_MOUSEBUTTONUP)
454
-				mouse_up(devmouse, 0x1 << (event.button.button - 1));
454
+				mouse_up(devmouse, SDL_BUTTON(event.button.button));
455 455
 			else if(event.type == SDL_MOUSEBUTTONDOWN)
456
-				mouse_down(devmouse, 0x1 << (event.button.button - 1));
456
+				mouse_down(devmouse, SDL_BUTTON(event.button.button));
457 457
 			else if(event.type == SDL_MOUSEWHEEL)
458 458
 				mouse_scroll(devmouse, event.wheel.x, event.wheel.y);
459 459
 			/* Controller */