RG600 dpad is a hat.

This commit is contained in:
fewtarius 2022-09-05 07:09:13 -04:00
parent 6be1cc3159
commit 608ee03018
No known key found for this signature in database
GPG key ID: F4AE55305D1B8C1A

View file

@ -42,10 +42,10 @@ index 92d1a01..db4fec4 100644
// Button events
-#if defined(DEVICE_RG351P)
+#if defined(DEVICE_handheld)
+ #define BUTTON_PRESSED_UP event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 13
+ #define BUTTON_PRESSED_DOWN event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 14
+ #define BUTTON_PRESSED_LEFT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 15
+ #define BUTTON_PRESSED_RIGHT event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 16
+ #define BUTTON_PRESSED_UP event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_UP
+ #define BUTTON_PRESSED_DOWN event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_DOWN
+ #define BUTTON_PRESSED_LEFT event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_LEFT
+ #define BUTTON_PRESSED_RIGHT event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_RIGHT
+ #define BUTTON_PRESSED_PAGEUP event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 4 || event.jbutton.button == 6)
+ #define BUTTON_PRESSED_PAGEDOWN event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 5 || event.jbutton.button == 7)
+ #define BUTTON_PRESSED_VALIDATE event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 1