diff --git a/blackberry-qnx/frontend_qnx.h b/blackberry-qnx/frontend_qnx.h deleted file mode 100644 index fc7814b20a..0000000000 --- a/blackberry-qnx/frontend_qnx.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _FRONTENDQNX_H_ -#define _FRONTENDQNX_H_ - -#define MAX_PADS 8 - -//Internal helper functions -typedef struct { - // Static device info. -#ifdef HAVE_BB10 - screen_device_t handle; -#endif - int type; - int analogCount; - int buttonCount; - char id[64]; - char vendor[64]; - char product[64]; - - char device_name[64]; - int device; - int port; - int index; - - // Current state. - int buttons; - int analog0[3]; - int analog1[3]; -} input_device_t; - -//Device struct to port mapping -extern input_device_t *port_device[MAX_PADS]; - -extern unsigned pads_connected; - -#ifdef HAVE_BB10 -const struct platform_bind platform_keys[] = { - { SCREEN_A_GAME_BUTTON, "A button" }, - { SCREEN_B_GAME_BUTTON, "B button" }, - { SCREEN_C_GAME_BUTTON, "C button" }, - { SCREEN_X_GAME_BUTTON, "X button" }, - { SCREEN_Y_GAME_BUTTON, "Y button" }, - { SCREEN_Z_GAME_BUTTON, "Z button" }, - { SCREEN_MENU1_GAME_BUTTON, "Menu1 button" }, - { SCREEN_MENU2_GAME_BUTTON, "Menu2 button" }, - { SCREEN_MENU3_GAME_BUTTON, "Menu3 button" }, - { SCREEN_MENU4_GAME_BUTTON, "Menu4 button" }, - { SCREEN_L1_GAME_BUTTON, "L1 Button" }, - { SCREEN_L2_GAME_BUTTON, "L2 Button" }, - { SCREEN_L3_GAME_BUTTON, "L3 Button" }, - { SCREEN_R1_GAME_BUTTON, "R1 Button" }, - { SCREEN_R2_GAME_BUTTON, "R2 Button" }, - { SCREEN_R3_GAME_BUTTON, "R3 Button" }, - { SCREEN_DPAD_UP_GAME_BUTTON, "Up D-pad" }, - { SCREEN_DPAD_DOWN_GAME_BUTTON, "Down D-pad" }, - { SCREEN_DPAD_LEFT_GAME_BUTTON, "Left D-pad" }, - { SCREEN_DPAD_RIGHT_GAME_BUTTON, "Right D-pad" }, -}; -#endif - -enum input_devices -{ - DEVICE_NONE, -#ifdef HAVE_BB10 - DEVICE_WIIMOTE, - DEVICE_KEYPAD, - DEVICE_UNKNOWN, -#endif - DEVICE_KEYBOARD, - DEVICE_IPEGA, - DEVICE_LAST -}; - -extern input_device_t devices[MAX_PADS]; - -#endif diff --git a/griffin/griffin.c b/griffin/griffin.c index 1927b1f6ad..a346f869d0 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -314,7 +314,7 @@ INPUT #include "../input/apple_input.c" #include "../input/apple_joypad.c" #elif defined(__QNX__) -#include "../blackberry-qnx/qnx_input.c" +#include "../input/qnx_input.c" #elif defined(EMSCRIPTEN) #include "../input/rwebinput_input.c" #endif diff --git a/blackberry-qnx/qnx_input.c b/input/qnx_input.c similarity index 95% rename from blackberry-qnx/qnx_input.c rename to input/qnx_input.c index e50492c5aa..02a02abacc 100644 --- a/blackberry-qnx/qnx_input.c +++ b/input/qnx_input.c @@ -22,7 +22,45 @@ #include #include -#include "frontend_qnx.h" +#define MAX_PADS 8 + +#ifdef HAVE_BB10 +const struct platform_bind platform_keys[] = { + { SCREEN_A_GAME_BUTTON, "A button" }, + { SCREEN_B_GAME_BUTTON, "B button" }, + { SCREEN_C_GAME_BUTTON, "C button" }, + { SCREEN_X_GAME_BUTTON, "X button" }, + { SCREEN_Y_GAME_BUTTON, "Y button" }, + { SCREEN_Z_GAME_BUTTON, "Z button" }, + { SCREEN_MENU1_GAME_BUTTON, "Menu1 button" }, + { SCREEN_MENU2_GAME_BUTTON, "Menu2 button" }, + { SCREEN_MENU3_GAME_BUTTON, "Menu3 button" }, + { SCREEN_MENU4_GAME_BUTTON, "Menu4 button" }, + { SCREEN_L1_GAME_BUTTON, "L1 Button" }, + { SCREEN_L2_GAME_BUTTON, "L2 Button" }, + { SCREEN_L3_GAME_BUTTON, "L3 Button" }, + { SCREEN_R1_GAME_BUTTON, "R1 Button" }, + { SCREEN_R2_GAME_BUTTON, "R2 Button" }, + { SCREEN_R3_GAME_BUTTON, "R3 Button" }, + { SCREEN_DPAD_UP_GAME_BUTTON, "Up D-pad" }, + { SCREEN_DPAD_DOWN_GAME_BUTTON, "Down D-pad" }, + { SCREEN_DPAD_LEFT_GAME_BUTTON, "Left D-pad" }, + { SCREEN_DPAD_RIGHT_GAME_BUTTON, "Right D-pad" }, +}; +#endif + +enum input_devices +{ + DEVICE_NONE, +#ifdef HAVE_BB10 + DEVICE_WIIMOTE, + DEVICE_KEYPAD, + DEVICE_UNKNOWN, +#endif + DEVICE_KEYBOARD, + DEVICE_IPEGA, + DEVICE_LAST +}; #ifdef HAVE_BB10 #define MAX_TOUCH 16 @@ -30,6 +68,29 @@ #define MAX_TOUCH 4 #endif +typedef struct { + // Static device info. +#ifdef HAVE_BB10 + screen_device_t handle; +#endif + int type; + int analogCount; + int buttonCount; + char id[64]; + char vendor[64]; + char product[64]; + + char device_name[64]; + int device; + int port; + int index; + + // Current state. + int buttons; + int analog0[3]; + int analog1[3]; +} input_device_t; + struct touches { int16_t x, y;