diff --git a/SDL.dll b/SDL.dll index 3ce97a59..01b220d3 100644 Binary files a/SDL.dll and b/SDL.dll differ diff --git a/gfx2def.ini b/gfx2def.ini index 92c87f6d..d10330a9 100644 --- a/gfx2def.ini +++ b/gfx2def.ini @@ -333,15 +333,4 @@ ; OS isn't able to do it by itself. (ie: Windows) Window_position = 9999,9999; (Default 9999,9999 which means: NA) - ; The program uses SDL's Unicode support to translate key combinations - ; into characters, when you're typing in textboxes. However, on - ; Windows 98 and if you're using a French or German keyboard, SDL has a - ; rather severe bug: The key ^ causes an instant crash if the key - ; that follows it isn't space or a vowel (the ones that make it a valid - ; combination : ^âêîôû) - ; If this problem concerns you, disable unicode below, and it will never - ; crash. This won't affect keyboard shortcuts, but in text fields you'll be - ; typing in US-QWERTY mode. - Use_unicode = yes ; (Default 'yes') - ; end of configuration diff --git a/keyboard.c b/keyboard.c index 84594e90..cdeed756 100644 --- a/keyboard.c +++ b/keyboard.c @@ -543,59 +543,19 @@ word Keysym_to_ANSI(SDL_keysym keysym) #if !(defined(__macosx__) || defined(__FreeBSD__)) if ( keysym.unicode == 0) { - byte shift; - - shift = (SDL_GetModState() & (KMOD_SHIFT|KMOD_CAPS)) != 0; - // Convert keypad to numbers - if (keysym.sym >= SDLK_KP0 && keysym.sym <= SDLK_KP9) - return ('0' - SDLK_KP0) + keysym.sym; - - // Conversion with shift on - if (shift) + switch(keysym.sym) { - // Lowercase to uppercase. - if (keysym.sym >= 'a' && keysym.sym <= 'z' && shift) - return ('A' - 'a') + keysym.sym; - // Some shifts of QWERTY-US keys - switch (keysym.sym) - { - case '`': return '~'; - case '1': return '!'; - case '2': return '@'; - case '3': return '#'; - case '4': return '$'; - case '5': return '%'; - case '6': return '^'; - case '7': return '&'; - case '8': return '*'; - case '9': return '('; - case '0': return ')'; - case '-': return '_'; - case '=': return '+'; - case '\\': return '|'; - case '[': return '{'; - case ']': return '}'; - case ';': return ':'; - case '\'': return '"'; - case ',': return '<'; - case '.': return '>'; - case '/': return '?'; - default: - return keysym.sym; - } - } - // More conversions - switch (keysym.sym) - { - case SDLK_KP_PERIOD: return '.'; - case SDLK_KP_DIVIDE: return '/'; - case SDLK_KP_MINUS: return '-'; - case SDLK_KP_MULTIPLY: return '*'; - case SDLK_KP_PLUS: return '+'; - case SDLK_KP_ENTER: return '\r'; - case SDLK_KP_EQUALS: return '='; - default: + case SDLK_DELETE: + case SDLK_LEFT: + case SDLK_RIGHT: + case SDLK_HOME: + case SDLK_END: + case SDLK_BACKSPACE: + case KEY_ESC: + case SDLK_RETURN: return keysym.sym; + default: + return 0; } } #endif diff --git a/readini.c b/readini.c index da0eb3b9..e4549072 100644 --- a/readini.c +++ b/readini.c @@ -798,12 +798,7 @@ int Load_INI(T_Config * conf) conf->Window_pos_x = values[0]; conf->Window_pos_y = values[1]; } - // Optional, Unicode support on/off (>98.0%) - conf->Use_unicode=1; - if (!Load_INI_get_values (file,buffer,"Use_unicode",1,values)) - { - conf->Use_unicode = (values[0]!=0); - } + fclose(file); diff --git a/readline.c b/readline.c index 613932ba..051714d9 100644 --- a/readline.c +++ b/readline.c @@ -142,8 +142,7 @@ 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é - if (Config.Use_unicode) - SDL_EnableUNICODE(SDL_ENABLE); + SDL_EnableUNICODE(SDL_ENABLE); Hide_cursor(); // Effacement de la chaîne @@ -349,8 +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)); - if (Config.Use_unicode) - SDL_EnableUNICODE(SDL_DISABLE); + SDL_EnableUNICODE(SDL_DISABLE); return (input_key==SDLK_RETURN); } diff --git a/saveini.c b/saveini.c index bf4077b4..ac8e53d3 100644 --- a/saveini.c +++ b/saveini.c @@ -635,9 +635,6 @@ int Save_INI(T_Config * conf) if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Window_position",2,values,0))) goto Erreur_Retour; - values[0]=conf->Use_unicode; - if ((return_code=Save_INI_set_values (Ancien_fichier,Nouveau_fichier,buffer,"Use_unicode",1,values,1))) - goto Erreur_Retour; Save_INI_flush(Ancien_fichier,Nouveau_fichier,buffer); diff --git a/struct.h b/struct.h index 0fe54840..81f26b0d 100644 --- a/struct.h +++ b/struct.h @@ -269,7 +269,6 @@ typedef struct char Bookmark_label[NB_BOOKMARKS][8+1];///< Bookmarked directories in fileselectors: This is the displayed name. int Window_pos_x; ///< Last window x position (9999 if unsupportd/irrelevant for the platform) int Window_pos_y; ///< Last window y position (9999 if unsupportd/irrelevant for the platform) - byte Use_unicode; ///< Boolean, true to use Unicode for keyboard input } T_Config; // Structures utilisées pour les descriptions de pages et de liste de pages.