update font to include australia title. Update other glyph mappings
[vg.git] / vg_input.c
index 3c138d0dad85b2e866153cbc3468e30c5340df51..74732f4d2c485ba871cbf024224bdc777809cc63 100644 (file)
@@ -395,19 +395,19 @@ const char *controller_button_str( SDL_GameControllerButton button )
 {
    static const char *controller_glyphs[ SDL_CONTROLLER_BUTTON_MAX ][2] = {
                                              /* xbox/generic  playstation */
-      [ SDL_CONTROLLER_BUTTON_A ]            = { "\x1e\x85","\x1e\x82" },
-      [ SDL_CONTROLLER_BUTTON_B ]            = { "\x1e\x86","\x1e\x81" },
-      [ SDL_CONTROLLER_BUTTON_X ]            = { "\x1e\x83","\x1e\x7f" },
-      [ SDL_CONTROLLER_BUTTON_Y ]            = { "\x1e\x84","\x1e\x80" },
-      [ SDL_CONTROLLER_BUTTON_LEFTSTICK ]    = { "\x87",    "\x87" },
-      [ SDL_CONTROLLER_BUTTON_RIGHTSTICK ]   = { "\x8b",    "\x8b" },
-      [ SDL_CONTROLLER_BUTTON_LEFTSHOULDER ] = { "\x91",    "\x91" },
-      [ SDL_CONTROLLER_BUTTON_RIGHTSHOULDER ]= { "\x92",    "\x92" },
-      [ SDL_CONTROLLER_BUTTON_DPAD_LEFT ]    = { "\x1e\x93","\x1e\x93" },
-      [ SDL_CONTROLLER_BUTTON_DPAD_UP ]      = { "\x1e\x94","\x1e\x94" },
-      [ SDL_CONTROLLER_BUTTON_DPAD_RIGHT ]   = { "\x1e\x95","\x1e\x95" },
-      [ SDL_CONTROLLER_BUTTON_DPAD_DOWN ]    = { "\x1e\x96","\x1e\x96" },
-      [ SDL_CONTROLLER_BUTTON_GUIDE ]        = { "\x91",    "\x91" },
+      [ SDL_CONTROLLER_BUTTON_A ]            = { KGRN "\x06\x02\x85",KBLU "\x06\x02\x82" },
+      [ SDL_CONTROLLER_BUTTON_B ]            = { KRED "\x06\x02\x86",KRED "\x06\x02\x81" },
+      [ SDL_CONTROLLER_BUTTON_X ]            = { KBLU "\x06\x02\x83",KMAG "\x06\x02\x7f" },
+      [ SDL_CONTROLLER_BUTTON_Y ]            = { KYEL "\x06\x02\x84",KGRN "\x06\x02\x80" },
+      [ SDL_CONTROLLER_BUTTON_LEFTSTICK ]    = { "\x87","\x87" },
+      [ SDL_CONTROLLER_BUTTON_RIGHTSTICK ]   = { "\x8b","\x8b" },
+      [ SDL_CONTROLLER_BUTTON_LEFTSHOULDER ] = { "\x91","\x91" },
+      [ SDL_CONTROLLER_BUTTON_RIGHTSHOULDER ]= { "\x92","\x92" },
+      [ SDL_CONTROLLER_BUTTON_DPAD_LEFT ]    = { "\x93","\x93" },
+      [ SDL_CONTROLLER_BUTTON_DPAD_UP ]      = { "\x94","\x94" },
+      [ SDL_CONTROLLER_BUTTON_DPAD_RIGHT ]   = { "\x95","\x95" },
+      [ SDL_CONTROLLER_BUTTON_DPAD_DOWN ]    = { "\x96","\x96" },
+      [ SDL_CONTROLLER_BUTTON_GUIDE ]        = { "\x91","\x91" },
    };
 
    if( vg_input.display_input_type == SDL_CONTROLLER_TYPE_PS3 ||
@@ -438,14 +438,7 @@ void vg_keyboard_key_string( vg_str *str, u32 key, int special_glyphs )
 {
    if( (key >= SDLK_a) && (key <= SDLK_z) ){
       key = (key-SDLK_a)+(u32)'A';
-
-      if( special_glyphs ){
-         vg_strcatch( str, '\x1f' );
-         vg_strcatch( str, key );
-         vg_strcatch( str, ' ' );
-      }
-      else
-         vg_strcatch( str, key );
+      vg_strcatch( str, key );
    }
    else if( (key == SDLK_LSHIFT) || (key == SDLK_RSHIFT) )
       vg_strcat( str, special_glyphs? "\x9e": "shift" );
@@ -460,13 +453,13 @@ void vg_keyboard_key_string( vg_str *str, u32 key, int special_glyphs )
    else if( key == SDLK_ESCAPE ) 
       vg_strcat( str, special_glyphs? "\xa3": "escape" );
    else if( key == SDLK_RIGHT )
-      vg_strcat( str, special_glyphs? "\x1f\x95 ": "right" );
+      vg_strcat( str, special_glyphs? "\x95 ": "right" );
    else if( key == SDLK_LEFT )
-      vg_strcat( str, special_glyphs? "\x1f\x93 ": "left" );
+      vg_strcat( str, special_glyphs? "\x93 ": "left" );
    else if( key == SDLK_UP )
-      vg_strcat( str, special_glyphs? "\x1f\x94 ": "up" );
+      vg_strcat( str, special_glyphs? "\x94 ": "up" );
    else if( key == SDLK_DOWN )
-      vg_strcat( str, special_glyphs? "\x1f\x96 ": "down" );
+      vg_strcat( str, special_glyphs? "\x96 ": "down" );
    else {
       vg_strcat( str, "keyboard key #" );
       vg_strcati32( str, key );