move KEY_* defines from global.h to keycodes.h
This commit is contained in:
parent
815e77aff3
commit
734bad13e1
117
src/global.h
117
src/global.h
@ -777,121 +777,4 @@ GFX2_GLOBAL iconv_t cd_utf16; // FROMCODE => UTF16
|
||||
GFX2_GLOBAL iconv_t cd_utf16_inv; // UTF16 => FROMCODE
|
||||
#endif /* ENABLE_FILENAMES_ICONV */
|
||||
|
||||
/// Indicates "no keyboard shortcut".
|
||||
#define KEY_NONE 0
|
||||
|
||||
#if defined(USE_SDL)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse 3rd button.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_MOUSEMIDDLE (SDLK_LAST+1)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse wheelup.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_MOUSEWHEELUP (SDLK_LAST+2)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse wheeldown.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_MOUSEWHEELDOWN (SDLK_LAST+3)
|
||||
///
|
||||
/// This is the "key identifier" for joystick button number 0.
|
||||
/// All numbers starting with this one are reserved for joystick buttons
|
||||
/// (since their is an unknown number of them, and for example 18 on GP2X)
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_JOYBUTTON (SDLK_LAST+4)
|
||||
|
||||
#else
|
||||
// Not SDL 1.2
|
||||
#define KEY_MOUSEMIDDLE 0x0210
|
||||
#define KEY_MOUSEX1 0x0211
|
||||
#define KEY_MOUSEX2 0x0212
|
||||
#define KEY_MOUSEWHEELUP 0x0200
|
||||
#define KEY_MOUSEWHEELDOWN 0x0201
|
||||
#define KEY_MOUSEWHEELLEFT 0x0202
|
||||
#define KEY_MOUSEWHEELRIGHT 0x0203
|
||||
#define KEY_JOYBUTTON 0x0100
|
||||
#endif
|
||||
|
||||
/// The joystick axis are {X,Y} - on all platforms so far.
|
||||
/// If there is ever a platform where they are reversed, put
|
||||
/// these lines in each platform "case" below.
|
||||
#define JOYSTICK_AXIS_X (0)
|
||||
#define JOYSTICK_AXIS_Y (1)
|
||||
|
||||
#ifdef __GP2X__
|
||||
|
||||
#define JOYSTICK_THRESHOLD (4096)
|
||||
|
||||
/// Button definitions for the gp2x
|
||||
#define JOY_BUTTON_UP (0)
|
||||
#define JOY_BUTTON_DOWN (4)
|
||||
#define JOY_BUTTON_LEFT (2)
|
||||
#define JOY_BUTTON_RIGHT (6)
|
||||
#define JOY_BUTTON_UPLEFT (1)
|
||||
#define JOY_BUTTON_UPRIGHT (7)
|
||||
#define JOY_BUTTON_DOWNLEFT (3)
|
||||
#define JOY_BUTTON_DOWNRIGHT (5)
|
||||
#define JOY_BUTTON_CLICK (18)
|
||||
#define JOY_BUTTON_A (12)
|
||||
#define JOY_BUTTON_B (13)
|
||||
#define JOY_BUTTON_Y (14)
|
||||
#define JOY_BUTTON_X (15)
|
||||
#define JOY_BUTTON_L (10)
|
||||
#define JOY_BUTTON_R (11)
|
||||
#define JOY_BUTTON_START (8)
|
||||
#define JOY_BUTTON_SELECT (9)
|
||||
#define JOY_BUTTON_VOLUP (16)
|
||||
#define JOY_BUTTON_VOLDOWN (17)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
|
||||
#elif defined(__WIZ__)
|
||||
/// Button definitions for the Wiz
|
||||
#define JOY_BUTTON_UP (0)
|
||||
#define JOY_BUTTON_DOWN (4)
|
||||
#define JOY_BUTTON_LEFT (2)
|
||||
#define JOY_BUTTON_RIGHT (6)
|
||||
#define JOY_BUTTON_UPLEFT (1)
|
||||
#define JOY_BUTTON_UPRIGHT (7)
|
||||
#define JOY_BUTTON_DOWNLEFT (3)
|
||||
#define JOY_BUTTON_DOWNRIGHT (5)
|
||||
#define JOY_BUTTON_L (10)
|
||||
#define JOY_BUTTON_R (11)
|
||||
#define JOY_BUTTON_A (12)
|
||||
#define JOY_BUTTON_B (13)
|
||||
#define JOY_BUTTON_X (14)
|
||||
#define JOY_BUTTON_Y (15)
|
||||
#define JOY_BUTTON_MENU (8)
|
||||
#define JOY_BUTTON_SELECT (9)
|
||||
#define JOY_BUTTON_VOLUP (16)
|
||||
#define JOY_BUTTON_VOLDOWN (17)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
|
||||
#elif defined (__CAANOO__)
|
||||
|
||||
#define JOYSTICK_THRESHOLD (4096)
|
||||
|
||||
/// Button definitions for the Caanoo
|
||||
#define JOY_BUTTON_A (0)
|
||||
#define JOY_BUTTON_X (1)
|
||||
#define JOY_BUTTON_B (2)
|
||||
#define JOY_BUTTON_Y (3)
|
||||
#define JOY_BUTTON_L (4)
|
||||
#define JOY_BUTTON_R (5)
|
||||
#define JOY_BUTTON_HOME (6)
|
||||
#define JOY_BUTTON_HOLD (7)
|
||||
#define JOY_BUTTON_I (8)
|
||||
#define JOY_BUTTON_II (9)
|
||||
#define JOY_BUTTON_JOY (10)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_HOME)
|
||||
#elif defined(USE_SDL) || defined(USE_SDL2)
|
||||
///
|
||||
/// This is the key identifier for ESC. When hard-coding keyboard shortcuts
|
||||
/// for buttons, etc. we use this instead of SDLK_ESCAPE,
|
||||
/// so the console ports can get a joybutton equivalent of it.
|
||||
#define KEY_ESC SDLK_ESCAPE
|
||||
#else
|
||||
#define KEY_ESC 1
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
115
src/keycodes.h
115
src/keycodes.h
@ -459,4 +459,119 @@
|
||||
// end of KEY definitions for others
|
||||
#endif
|
||||
|
||||
/// Indicates "no keyboard shortcut".
|
||||
#define KEY_NONE 0
|
||||
|
||||
#if defined(USE_SDL)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse 3rd button.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_MOUSEMIDDLE (SDLK_LAST+1)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse wheelup.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_MOUSEWHEELUP (SDLK_LAST+2)
|
||||
///
|
||||
/// This is the "key identifier" for the mouse wheeldown.
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_MOUSEWHEELDOWN (SDLK_LAST+3)
|
||||
///
|
||||
/// This is the "key identifier" for joystick button number 0.
|
||||
/// All numbers starting with this one are reserved for joystick buttons
|
||||
/// (since their is an unknown number of them, and for example 18 on GP2X)
|
||||
/// It was chosen to not conflict with any SDL key number.
|
||||
#define KEY_JOYBUTTON (SDLK_LAST+4)
|
||||
|
||||
#else
|
||||
// Not SDL 1.2
|
||||
#define KEY_MOUSEMIDDLE 0x0210
|
||||
#define KEY_MOUSEX1 0x0211
|
||||
#define KEY_MOUSEX2 0x0212
|
||||
#define KEY_MOUSEWHEELUP 0x0200
|
||||
#define KEY_MOUSEWHEELDOWN 0x0201
|
||||
#define KEY_MOUSEWHEELLEFT 0x0202
|
||||
#define KEY_MOUSEWHEELRIGHT 0x0203
|
||||
#define KEY_JOYBUTTON 0x0100
|
||||
#endif
|
||||
|
||||
/// The joystick axis are {X,Y} - on all platforms so far.
|
||||
/// If there is ever a platform where they are reversed, put
|
||||
/// these lines in each platform "case" below.
|
||||
#define JOYSTICK_AXIS_X (0)
|
||||
#define JOYSTICK_AXIS_Y (1)
|
||||
|
||||
#ifdef __GP2X__
|
||||
|
||||
#define JOYSTICK_THRESHOLD (4096)
|
||||
|
||||
/// Button definitions for the gp2x
|
||||
#define JOY_BUTTON_UP (0)
|
||||
#define JOY_BUTTON_DOWN (4)
|
||||
#define JOY_BUTTON_LEFT (2)
|
||||
#define JOY_BUTTON_RIGHT (6)
|
||||
#define JOY_BUTTON_UPLEFT (1)
|
||||
#define JOY_BUTTON_UPRIGHT (7)
|
||||
#define JOY_BUTTON_DOWNLEFT (3)
|
||||
#define JOY_BUTTON_DOWNRIGHT (5)
|
||||
#define JOY_BUTTON_CLICK (18)
|
||||
#define JOY_BUTTON_A (12)
|
||||
#define JOY_BUTTON_B (13)
|
||||
#define JOY_BUTTON_Y (14)
|
||||
#define JOY_BUTTON_X (15)
|
||||
#define JOY_BUTTON_L (10)
|
||||
#define JOY_BUTTON_R (11)
|
||||
#define JOY_BUTTON_START (8)
|
||||
#define JOY_BUTTON_SELECT (9)
|
||||
#define JOY_BUTTON_VOLUP (16)
|
||||
#define JOY_BUTTON_VOLDOWN (17)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
|
||||
#elif defined(__WIZ__)
|
||||
/// Button definitions for the Wiz
|
||||
#define JOY_BUTTON_UP (0)
|
||||
#define JOY_BUTTON_DOWN (4)
|
||||
#define JOY_BUTTON_LEFT (2)
|
||||
#define JOY_BUTTON_RIGHT (6)
|
||||
#define JOY_BUTTON_UPLEFT (1)
|
||||
#define JOY_BUTTON_UPRIGHT (7)
|
||||
#define JOY_BUTTON_DOWNLEFT (3)
|
||||
#define JOY_BUTTON_DOWNRIGHT (5)
|
||||
#define JOY_BUTTON_L (10)
|
||||
#define JOY_BUTTON_R (11)
|
||||
#define JOY_BUTTON_A (12)
|
||||
#define JOY_BUTTON_B (13)
|
||||
#define JOY_BUTTON_X (14)
|
||||
#define JOY_BUTTON_Y (15)
|
||||
#define JOY_BUTTON_MENU (8)
|
||||
#define JOY_BUTTON_SELECT (9)
|
||||
#define JOY_BUTTON_VOLUP (16)
|
||||
#define JOY_BUTTON_VOLDOWN (17)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
|
||||
#elif defined (__CAANOO__)
|
||||
|
||||
#define JOYSTICK_THRESHOLD (4096)
|
||||
|
||||
/// Button definitions for the Caanoo
|
||||
#define JOY_BUTTON_A (0)
|
||||
#define JOY_BUTTON_X (1)
|
||||
#define JOY_BUTTON_B (2)
|
||||
#define JOY_BUTTON_Y (3)
|
||||
#define JOY_BUTTON_L (4)
|
||||
#define JOY_BUTTON_R (5)
|
||||
#define JOY_BUTTON_HOME (6)
|
||||
#define JOY_BUTTON_HOLD (7)
|
||||
#define JOY_BUTTON_I (8)
|
||||
#define JOY_BUTTON_II (9)
|
||||
#define JOY_BUTTON_JOY (10)
|
||||
|
||||
#define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_HOME)
|
||||
#else
|
||||
///
|
||||
/// This is the key identifier for ESC. When hard-coding keyboard shortcuts
|
||||
/// for buttons, etc. we use this instead of SDLK_ESCAPE,
|
||||
/// so the console ports can get a joybutton equivalent of it.
|
||||
#define KEY_ESC KEY_ESCAPE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
#include "const.h"
|
||||
#include "errors.h"
|
||||
#include "global.h"
|
||||
#include "keycodes.h"
|
||||
#include "io.h"
|
||||
#include "loadsave.h"
|
||||
#include "misc.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user