Unification of button system for the three current console ports.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1630 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-09-29 23:06:26 +00:00
parent bd13dd93b1
commit e3e9be75b0
4 changed files with 238 additions and 259 deletions

View File

@ -966,64 +966,64 @@ GFX2_GLOBAL SDL_Joystick* Joystick;
#define JOYSTICK_THRESHOLD (4096) #define JOYSTICK_THRESHOLD (4096)
/// Button definitions for the gp2x /// Button definitions for the gp2x
#define GP2X_BUTTON_UP (0) #define JOY_BUTTON_UP (0)
#define GP2X_BUTTON_DOWN (4) #define JOY_BUTTON_DOWN (4)
#define GP2X_BUTTON_LEFT (2) #define JOY_BUTTON_LEFT (2)
#define GP2X_BUTTON_RIGHT (6) #define JOY_BUTTON_RIGHT (6)
#define GP2X_BUTTON_UPLEFT (1) #define JOY_BUTTON_UPLEFT (1)
#define GP2X_BUTTON_UPRIGHT (7) #define JOY_BUTTON_UPRIGHT (7)
#define GP2X_BUTTON_DOWNLEFT (3) #define JOY_BUTTON_DOWNLEFT (3)
#define GP2X_BUTTON_DOWNRIGHT (5) #define JOY_BUTTON_DOWNRIGHT (5)
#define GP2X_BUTTON_CLICK (18) #define JOY_BUTTON_CLICK (18)
#define GP2X_BUTTON_A (12) #define JOY_BUTTON_A (12)
#define GP2X_BUTTON_B (13) #define JOY_BUTTON_B (13)
#define GP2X_BUTTON_Y (14) #define JOY_BUTTON_Y (14)
#define GP2X_BUTTON_X (15) #define JOY_BUTTON_X (15)
#define GP2X_BUTTON_L (10) #define JOY_BUTTON_L (10)
#define GP2X_BUTTON_R (11) #define JOY_BUTTON_R (11)
#define GP2X_BUTTON_START (8) #define JOY_BUTTON_START (8)
#define GP2X_BUTTON_SELECT (9) #define JOY_BUTTON_SELECT (9)
#define GP2X_BUTTON_VOLUP (16) #define JOY_BUTTON_VOLUP (16)
#define GP2X_BUTTON_VOLDOWN (17) #define JOY_BUTTON_VOLDOWN (17)
#define KEY_ESC (KEY_JOYBUTTON+GP2X_BUTTON_X) #define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
#elif defined(__WIZ__) #elif defined(__WIZ__)
/// Button definitions for the Wiz /// Button definitions for the Wiz
#define WIZ_BUTTON_UP (0) #define JOY_BUTTON_UP (0)
#define WIZ_BUTTON_DOWN (4) #define JOY_BUTTON_DOWN (4)
#define WIZ_BUTTON_LEFT (2) #define JOY_BUTTON_LEFT (2)
#define WIZ_BUTTON_RIGHT (6) #define JOY_BUTTON_RIGHT (6)
#define WIZ_BUTTON_UPLEFT (1) #define JOY_BUTTON_UPLEFT (1)
#define WIZ_BUTTON_UPRIGHT (7) #define JOY_BUTTON_UPRIGHT (7)
#define WIZ_BUTTON_DOWNLEFT (3) #define JOY_BUTTON_DOWNLEFT (3)
#define WIZ_BUTTON_DOWNRIGHT (5) #define JOY_BUTTON_DOWNRIGHT (5)
#define WIZ_BUTTON_L (10) #define JOY_BUTTON_L (10)
#define WIZ_BUTTON_R (11) #define JOY_BUTTON_R (11)
#define WIZ_BUTTON_A (12) #define JOY_BUTTON_A (12)
#define WIZ_BUTTON_B (13) #define JOY_BUTTON_B (13)
#define WIZ_BUTTON_X (14) #define JOY_BUTTON_X (14)
#define WIZ_BUTTON_Y (15) #define JOY_BUTTON_Y (15)
#define WIZ_BUTTON_MENU (8) #define JOY_BUTTON_MENU (8)
#define WIZ_BUTTON_SELECT (9) #define JOY_BUTTON_SELECT (9)
#define WIZ_BUTTON_VOLUP (16) #define JOY_BUTTON_VOLUP (16)
#define WIZ_BUTTON_VOLDOWN (17) #define JOY_BUTTON_VOLDOWN (17)
#define KEY_ESC (KEY_JOYBUTTON+WIZ_BUTTON_X) #define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_X)
#elif __CAANOO__ #elif __CAANOO__
/// Button definitions for the Caanoo /// Button definitions for the Caanoo
#define CAANOO_BUTTON_A (0) #define JOY_BUTTON_A (0)
#define CAANOO_BUTTON_X (1) #define JOY_BUTTON_X (1)
#define CAANOO_BUTTON_B (2) #define JOY_BUTTON_B (2)
#define CAANOO_BUTTON_Y (3) #define JOY_BUTTON_Y (3)
#define CAANOO_BUTTON_L (4) #define JOY_BUTTON_L (4)
#define CAANOO_BUTTON_R (5) #define JOY_BUTTON_R (5)
#define CAANOO_BUTTON_HOME (6) #define JOY_BUTTON_HOME (6)
#define CAANOO_BUTTON_HOLD (7) #define JOY_BUTTON_HOLD (7)
#define CAANOO_BUTTON_I (8) #define JOY_BUTTON_I (8)
#define CAANOO_BUTTON_II (9) #define JOY_BUTTON_II (9)
#define CAANOO_BUTTON_JOY (10) #define JOY_BUTTON_JOY (10)
#define KEY_ESC (KEY_JOYBUTTON+CAANOO_BUTTON_HOME) #define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_HOME)
#else #else
/// ///
/// This is the key identifier for ESC. When hard-coding keyboard shortcuts /// This is the key identifier for ESC. When hard-coding keyboard shortcuts

View File

@ -884,7 +884,16 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
"", "",
true, true,
SDLK_u, // U SDLK_u, // U
0}, // Secondary shortcut is button I on the Caanoo, L on the Wiz, unset on others
#if defined (__CAANOO__)
(KEY_JOYBUTTON+JOY_BUTTON_I)
#elif defined (__WIZ__)
(KEY_JOYBUTTON+JOY_BUTTON_L)
#else
0
#endif
// --
},
{103, {103,
"Redo", "Redo",
"Redo the last undone action.", "Redo the last undone action.",
@ -892,7 +901,16 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
"", "",
true, true,
SDLK_u|MOD_SHIFT, // Shift + U SDLK_u|MOD_SHIFT, // Shift + U
0}, // Secondary shortcut is button II on the Caanoo, R on the Wiz, unset on others
#if defined (__CAANOO__)
(KEY_JOYBUTTON+JOY_BUTTON_II)
#elif defined (__WIZ__)
(KEY_JOYBUTTON+JOY_BUTTON_R)
#else
0
#endif
// --
},
{133, {133,
"Kill", "Kill",
"Kills the current page. It actually", "Kills the current page. It actually",
@ -924,7 +942,17 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
"confirmation is asked.", "confirmation is asked.",
false, false,
SDLK_q, // Q (A en AZERTY) SDLK_q, // Q (A en AZERTY)
0}, // Secondary shortcut is button Home on the Caanoo, Menu on the Wiz, unset on others
#if defined (__CAANOO__)
(KEY_JOYBUTTON+JOY_BUTTON_HOME)
#elif defined (__WIZ__)
(KEY_JOYBUTTON+JOY_BUTTON_MENU)
#else
0
#endif
// --
},
{107, {107,
"Palette menu", "Palette menu",
"Opens a menu which allows you to", "Opens a menu which allows you to",

View File

@ -88,29 +88,29 @@ short Mouse_virtual_height;
#if defined(__GP2X__) #if defined(__GP2X__)
#define JOYSTICK_THRESHOLD (4096) #define JOYSTICK_THRESHOLD (4096)
short Joybutton_shift=GP2X_BUTTON_L; short Joybutton_shift= JOY_BUTTON_L;
short Joybutton_control=GP2X_BUTTON_R; short Joybutton_control= JOY_BUTTON_R;
short Joybutton_alt=GP2X_BUTTON_CLICK; short Joybutton_alt= JOY_BUTTON_CLICK;
short Joybutton_left_click=GP2X_BUTTON_B; short Joybutton_left_click= JOY_BUTTON_B;
short Joybutton_right_click=GP2X_BUTTON_Y; short Joybutton_right_click=JOY_BUTTON_Y;
#elif defined(__WIZ__) #elif defined(__WIZ__)
#define JOYSTICK_THRESHOLD (4096) #define JOYSTICK_THRESHOLD (4096)
short Joybutton_shift=WIZ_BUTTON_X; short Joybutton_shift= JOY_BUTTON_X;
short Joybutton_control=WIZ_BUTTON_SELECT; short Joybutton_control= JOY_BUTTON_SELECT;
short Joybutton_alt=WIZ_BUTTON_Y; short Joybutton_alt= JOY_BUTTON_Y;
short Joybutton_left_click=WIZ_BUTTON_A; short Joybutton_left_click= JOY_BUTTON_A;
short Joybutton_right_click=WIZ_BUTTON_B; short Joybutton_right_click=JOY_BUTTON_B;
#elif defined(__CAANOO__) #elif defined(__CAANOO__)
#define JOYSTICK_THRESHOLD (4096) #define JOYSTICK_THRESHOLD (4096)
short Joybutton_shift=CAANOO_BUTTON_L; short Joybutton_shift= JOY_BUTTON_L;
short Joybutton_control=CAANOO_BUTTON_R; short Joybutton_control= JOY_BUTTON_R;
short Joybutton_alt=CAANOO_BUTTON_Y; short Joybutton_alt= JOY_BUTTON_Y;
short Joybutton_left_click=CAANOO_BUTTON_A; short Joybutton_left_click= JOY_BUTTON_A;
short Joybutton_right_click=CAANOO_BUTTON_B; short Joybutton_right_click=JOY_BUTTON_B;
#else // Default : Any joystick on a computer platform #else // Default : Any joystick on a computer platform
/// ///
@ -537,106 +537,53 @@ int Handle_joystick_press(SDL_JoyButtonEvent event)
Input_new_mouse_K=2; Input_new_mouse_K=2;
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
} }
#if defined(__GP2X__)
switch(event.button) switch(event.button)
{ {
case GP2X_BUTTON_UP: #ifdef JOY_BUTTON_UP
case JOY_BUTTON_UP:
Directional_up=1; Directional_up=1;
break; break;
case GP2X_BUTTON_UPRIGHT: #endif
#ifdef JOY_BUTTON_UPRIGHT
case JOY_BUTTON_UPRIGHT:
Directional_up_right=1; Directional_up_right=1;
break; break;
case GP2X_BUTTON_RIGHT: #endif
#ifdef JOY_BUTTON_RIGHT
case JOY_BUTTON_RIGHT:
Directional_right=1; Directional_right=1;
break; break;
case GP2X_BUTTON_DOWNRIGHT: #endif
#ifdef JOY_BUTTON_DOWNRIGHT
case JOY_BUTTON_DOWNRIGHT:
Directional_down_right=1; Directional_down_right=1;
break; break;
case GP2X_BUTTON_DOWN: #endif
#ifdef JOY_BUTTON_DOWN
case JOY_BUTTON_DOWN:
Directional_down=1; Directional_down=1;
break; break;
case GP2X_BUTTON_DOWNLEFT: #endif
#ifdef JOY_BUTTON_DOWNLEFT
case JOY_BUTTON_DOWNLEFT:
Directional_down_left=1; Directional_down_left=1;
break; break;
case GP2X_BUTTON_LEFT: #endif
#ifdef JOY_BUTTON_LEFT
case JOY_BUTTON_LEFT:
Directional_left=1; Directional_left=1;
break; break;
case GP2X_BUTTON_UPLEFT: #endif
#ifdef JOY_BUTTON_UPLEFT
case JOY_BUTTON_UPLEFT:
Directional_up_left=1; Directional_up_left=1;
break; break;
#endif
default: default:
break; break;
}
#elif __WIZ__
switch(event.button)
{
case WIZ_BUTTON_UP:
Directional_up=1;
break;
case WIZ_BUTTON_UPRIGHT:
Directional_up_right=1;
break;
case WIZ_BUTTON_RIGHT:
Directional_right=1;
break;
case WIZ_BUTTON_DOWNRIGHT:
Directional_down_right=1;
break;
case WIZ_BUTTON_DOWN:
Directional_down=1;
break;
case WIZ_BUTTON_DOWNLEFT:
Directional_down_left=1;
case WIZ_BUTTON_LEFT:
Directional_left=1;
break;
case WIZ_BUTTON_UPLEFT:
Directional_up_left=1;
break;
case WIZ_BUTTON_MENU:
{
SDL_Event Event;
Event.type = SDL_QUIT;
SDL_PushEvent(&Event);
}
break;
case WIZ_BUTTON_L:
if(!Windows_open)
Button_Undo();
break;
case WIZ_BUTTON_R:
if(!Windows_open)
Button_Redo();
break;
default:
break;
}
#elif __CAANOO__
switch(event.button)
{
case CAANOO_BUTTON_HOME:
{
SDL_Event Event;
Event.type = SDL_QUIT;
SDL_PushEvent(&Event);
}
break;
case CAANOO_BUTTON_I:
if(!Windows_open)
Button_Undo();
break;
case CAANOO_BUTTON_II:
if(!Windows_open)
Button_Redo();
break;
default:
break;
} }
#endif
Key = (KEY_JOYBUTTON+event.button)|Key_modifiers(SDL_GetModState()); Key = (KEY_JOYBUTTON+event.button)|Key_modifiers(SDL_GetModState());
// TODO: systeme de répétition // TODO: systeme de répétition
@ -671,63 +618,52 @@ int Handle_joystick_release(SDL_JoyButtonEvent event)
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
} }
#if defined(__GP2X__)
switch(event.button) switch(event.button)
{ {
case GP2X_BUTTON_UP: #ifdef JOY_BUTTON_UP
Directional_up=0; case JOY_BUTTON_UP:
Directional_up=1;
break; break;
case GP2X_BUTTON_UPRIGHT: #endif
Directional_up_right=0; #ifdef JOY_BUTTON_UPRIGHT
case JOY_BUTTON_UPRIGHT:
Directional_up_right=1;
break; break;
case GP2X_BUTTON_RIGHT: #endif
Directional_right=0; #ifdef JOY_BUTTON_RIGHT
case JOY_BUTTON_RIGHT:
Directional_right=1;
break; break;
case GP2X_BUTTON_DOWNRIGHT: #endif
Directional_down_right=0; #ifdef JOY_BUTTON_DOWNRIGHT
case JOY_BUTTON_DOWNRIGHT:
Directional_down_right=1;
break; break;
case GP2X_BUTTON_DOWN: #endif
Directional_down=0; #ifdef JOY_BUTTON_DOWN
case JOY_BUTTON_DOWN:
Directional_down=1;
break; break;
case GP2X_BUTTON_DOWNLEFT: #endif
Directional_down_left=0; #ifdef JOY_BUTTON_DOWNLEFT
case JOY_BUTTON_DOWNLEFT:
Directional_down_left=1;
break; break;
case GP2X_BUTTON_LEFT: #endif
Directional_left=0; #ifdef JOY_BUTTON_LEFT
case JOY_BUTTON_LEFT:
Directional_left=1;
break; break;
case GP2X_BUTTON_UPLEFT: #endif
Directional_up_left=0; #ifdef JOY_BUTTON_UPLEFT
case JOY_BUTTON_UPLEFT:
Directional_up_left=1;
break;
#endif
default:
break; break;
} }
#elif defined(__WIZ__)
switch(event.button)
{
case WIZ_BUTTON_UP:
Directional_up=0;
break;
case WIZ_BUTTON_UPRIGHT:
Directional_up_right=0;
break;
case WIZ_BUTTON_RIGHT:
Directional_right=0;
break;
case WIZ_BUTTON_DOWNRIGHT:
Directional_down_right=0;
break;
case WIZ_BUTTON_DOWN:
Directional_down=0;
break;
case WIZ_BUTTON_DOWNLEFT:
Directional_down_left=0;
break;
case WIZ_BUTTON_LEFT:
Directional_left=0;
break;
case WIZ_BUTTON_UPLEFT:
Directional_up_left=0;
break;
}
#endif
return Move_cursor_with_constraints(); return Move_cursor_with_constraints();
} }

View File

@ -466,78 +466,93 @@ const char * Key_name(word key)
key=key & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT); key=key & ~(MOD_CTRL|MOD_ALT|MOD_SHIFT);
#if defined(__GP2X__) // 99 is only a sanity check
if (key>=KEY_JOYBUTTON && key<=KEY_JOYBUTTON+18) if (key>=KEY_JOYBUTTON && key<=KEY_JOYBUTTON+99)
{ {
char *button_name; char *button_name;
switch(key-KEY_JOYBUTTON) switch(key-KEY_JOYBUTTON)
{ {
case GP2X_BUTTON_UP: button_name="[UP]"; break; #ifdef JOY_BUTTON_UP
case GP2X_BUTTON_DOWN: button_name="[DOWN]"; break; case JOY_BUTTON_UP: button_name="[UP]"; break;
case GP2X_BUTTON_LEFT: button_name="[LEFT]"; break; #endif
case GP2X_BUTTON_RIGHT: button_name="[RIGHT]"; break; #ifdef JOY_BUTTON_DOWN
case GP2X_BUTTON_UPLEFT: button_name="[UP-LEFT]"; break; case JOY_BUTTON_DOWN: button_name="[DOWN]"; break;
case GP2X_BUTTON_UPRIGHT: button_name="[UP-RIGHT]"; break; #endif
case GP2X_BUTTON_DOWNLEFT: button_name="[DOWN-LEFT]"; break; #ifdef JOY_BUTTON_LEFT
case GP2X_BUTTON_DOWNRIGHT: button_name="[DOWN-RIGHT]"; break; case JOY_BUTTON_LEFT: button_name="[LEFT]"; break;
case GP2X_BUTTON_CLICK: button_name="[CLICK]"; break; #endif
case GP2X_BUTTON_A: button_name="[A]"; break; #ifdef JOY_BUTTON_RIGHT
case GP2X_BUTTON_B: button_name="[B]"; break; case JOY_BUTTON_RIGHT: button_name="[RIGHT]"; break;
case GP2X_BUTTON_X: button_name="[X]"; break; #endif
case GP2X_BUTTON_Y: button_name="[Y]"; break; #ifdef JOY_BUTTON_UPLEFT
case GP2X_BUTTON_L: button_name="[L]"; break; case JOY_BUTTON_UPLEFT: button_name="[UP-LEFT]"; break;
case GP2X_BUTTON_R: button_name="[R]"; break; #endif
case GP2X_BUTTON_START: button_name="[START]"; break; #ifdef JOY_BUTTON_UPRIGHT
case GP2X_BUTTON_SELECT: button_name="[SELECT]"; break; case JOY_BUTTON_UPRIGHT: button_name="[UP-RIGHT]"; break;
case GP2X_BUTTON_VOLUP: button_name="[VOL UP]"; break; #endif
case GP2X_BUTTON_VOLDOWN: button_name="[VOL DOWN]"; break; #ifdef JOY_BUTTON_DOWNLEFT
default: sprintf(buffer+strlen(buffer), "[B%d]", key);return buffer; case JOY_BUTTON_DOWNLEFT: button_name="[DOWN-LEFT]"; break;
#endif
#ifdef JOY_BUTTON_DOWNRIGHT
case JOY_BUTTON_DOWNRIGHT: button_name="[DOWN-RIGHT]"; break;
#endif
#ifdef JOY_BUTTON_CLICK
case JOY_BUTTON_CLICK: button_name="[CLICK]"; break;
#endif
#ifdef JOY_BUTTON_A
case JOY_BUTTON_A: button_name="[A]"; break;
#endif
#ifdef JOY_BUTTON_B
case JOY_BUTTON_B: button_name="[B]"; break;
#endif
#ifdef JOY_BUTTON_X
case JOY_BUTTON_X: button_name="[X]"; break;
#endif
#ifdef JOY_BUTTON_Y
case JOY_BUTTON_Y: button_name="[Y]"; break;
#endif
#ifdef JOY_BUTTON_L
case JOY_BUTTON_L: button_name="[L]"; break;
#endif
#ifdef JOY_BUTTON_R
case JOY_BUTTON_R: button_name="[R]"; break;
#endif
#ifdef JOY_BUTTON_START
case JOY_BUTTON_START: button_name="[START]"; break;
#endif
#ifdef JOY_BUTTON_SELECT
case JOY_BUTTON_SELECT: button_name="[SELECT]"; break;
#endif
#ifdef JOY_BUTTON_VOLUP
case JOY_BUTTON_VOLUP: button_name="[VOL UP]"; break;
#endif
#ifdef JOY_BUTTON_VOLDOWN
case JOY_BUTTON_VOLDOWN: button_name="[VOL DOWN]"; break;
#endif
#ifdef JOY_BUTTON_MENU
case JOY_BUTTON_MENU: button_name="[MENU]"; break;
#endif
#ifdef JOY_BUTTON_HOME
case JOY_BUTTON_HOME: button_name="[HOME]"; break;
#endif
#ifdef JOY_BUTTON_HOLD
case JOY_BUTTON_HOLD: button_name="[HOLD]"; break;
#endif
#ifdef JOY_BUTTON_I
case JOY_BUTTON_I: button_name="[BUTTON I]"; break;
#endif
#ifdef JOY_BUTTON_II
case JOY_BUTTON_II: button_name="[BUTTON II]"; break;
#endif
#ifdef JOY_BUTTON_JOY
case JOY_BUTTON_JOY: button_name="[THUMB JOY]"; break;
#endif
default: sprintf(buffer+strlen(buffer), "[B%d]", key-KEY_JOYBUTTON);return buffer;
} }
strcat(buffer,button_name); strcat(buffer,button_name);
#elif defined(__WIZ__)
if (Key>=KEY_JOYBUTTON && Key<=KEY_JOYBUTTON+17)
{
char *button_name;
switch(Key-KEY_JOYBUTTON)
{
case WIZ_BUTTON_A: button_name="[A]"; break;
case WIZ_BUTTON_X: button_name="[X]"; break;
case WIZ_BUTTON_B: button_name="[B]"; break;
case WIZ_BUTTON_Y: button_name="[Y]"; break;
case WIZ_BUTTON_L: button_name="[L]"; break;
case WIZ_BUTTON_R: button_name="[R]"; break;
case WIZ_BUTTON_MENU: button_name="[MENU]"; break;
case WIZ_BUTTON_SELECT: button_name="[SELECT]"; break;
case WIZ_BUTTON_VOLUP: button_name="[VOL UP]"; break;
case WIZ_BUTTON_VOLDOWN: button_name="[VOL DOWN]"; break;
default: sprintf(buffer+strlen(buffer), "[B%d]", Key);return buffer;
}
strcat(buffer,button_name);
#elif defined(__CAANOO__)
if (Key>=KEY_JOYBUTTON && Key<=KEY_JOYBUTTON+10)
{
char *button_name;
switch(Key-KEY_JOYBUTTON)
{
case CAANOO_BUTTON_A: button_name="[A]"; break;
case CAANOO_BUTTON_X: button_name="[X]"; break;
case CAANOO_BUTTON_B: button_name="[B]"; break;
case CAANOO_BUTTON_Y: button_name="[Y]"; break;
case CAANOO_BUTTON_L: button_name="[L]"; break;
case CAANOO_BUTTON_R: button_name="[R]"; break;
case CAANOO_BUTTON_HOME: button_name="[HOME]"; break;
case CAANOO_BUTTON_HOLD: button_name="[HOLD]"; break;
case CAANOO_BUTTON_I: button_name="[BUTTON I]"; break;
case CAANOO_BUTTON_II: button_name="[BUTTON II]"; break;
case CAANOO_BUTTON_JOY: button_name="[THUMB JOY]"; break;
default: sprintf(buffer+strlen(buffer), "[B%d]", Key);return buffer;
}
strcat(buffer,button_name);
#else
{
sprintf(buffer+strlen(buffer), "[B%d]", key-KEY_JOYBUTTON);
#endif
return buffer; return buffer;
} }