diff --git a/keyboard.c b/keyboard.c index e311d81a..b1289696 100644 --- a/keyboard.c +++ b/keyboard.c @@ -543,6 +543,9 @@ word Keysym_to_ANSI(SDL_keysym keysym) #if !(defined(__macosx__) || defined(__FreeBSD__)) if ( keysym.unicode == 0) { + // Converty lowercase to uppercase if SHIFT is on. + if (keysym.sym >= 'a' && keysym.sym <= 'z' && (SDL_GetModState() & (KMOD_SHIFT|KMOD_CAPS))) + return ('A' - 'a') + keysym.sym; return keysym.sym; } #endif diff --git a/main.c b/main.c index 8410089f..aa889aee 100644 --- a/main.c +++ b/main.c @@ -404,7 +404,6 @@ int Init_program(int argc,char * argv[]) } Joystick = SDL_JoystickOpen(0); SDL_EnableKeyRepeat(250, 32); - SDL_EnableUNICODE(SDL_ENABLE); if(ALPHA_BETA[0]=='ß') SDL_WM_SetCaption("GrafX2 beta "PERCENTAGE_VERSION,"GrafX2"); else diff --git a/readline.c b/readline.c index 293de1b5..051714d9 100644 --- a/readline.c +++ b/readline.c @@ -142,6 +142,8 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz byte offset=0; // index du premier caractère affiché + SDL_EnableUNICODE(SDL_ENABLE); + Hide_cursor(); // Effacement de la chaîne Block(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), @@ -346,5 +348,7 @@ affichage: Update_rect(Window_pos_X+(x_pos*Menu_factor_X),Window_pos_Y+(y_pos*Menu_factor_Y), visible_size*(Menu_factor_X<<3),(Menu_factor_Y<<3)); + SDL_EnableUNICODE(SDL_DISABLE); + return (input_key==SDLK_RETURN); }