Revert "Add back missing azerty stuff"

This reverts commit f9be340ca1.
This commit is contained in:
NepDisk 2026-02-22 13:28:14 -05:00
parent f9be340ca1
commit de8bbc8525
6 changed files with 11 additions and 183 deletions

View file

@ -680,46 +680,6 @@ INT32 CON_ShiftChar(INT32 ch)
if (I_UseNativeKeyboard())
return ch;
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
if (cv_keyboardlayout.value == 3)
{
if (shiftdown ^ capslock)
ch = shiftxform[ch];
else if (altdown & 0x2)
ch = french_altgrxform[ch];
else
ch = HU_FallBackFrSpecialLetter(ch);
}
else
{
if (shiftdown ^ capslock)
ch = shiftxform[ch];
}
}
else // if we're holding shift we should still shift non letter symbols
{
if (cv_keyboardlayout.value == 3)
{
if (shiftdown)
ch = shiftxform[ch];
else if (altdown & 0x2)
ch = french_altgrxform[ch];
else
ch = HU_FallBackFrSpecialLetter(ch);
}
else
{
if (shiftdown)
ch = shiftxform[ch];
}
}
return ch;
}
INT32 CON_ShitAndAltGrChar(INT32 ch)
{
if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
{
if (shiftdown ^ capslock)
@ -729,14 +689,6 @@ INT32 CON_ShitAndAltGrChar(INT32 ch)
{
if (shiftdown)
ch = shiftxform[ch];
else if (altdown & 0x2)
{
ch = french_altgrxform[ch];
}
else
{
ch = HU_FallBackFrSpecialLetter(ch);
}
}
return ch;
@ -941,7 +893,7 @@ boolean CON_Responder(event_t *ev)
return true;
// ctrl modifier -- changes behavior, adds shortcuts
if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown))
if (ctrldown)
{
// show all cvars/commands that match what we have inputted
if (key == KEY_TAB)

View file

@ -75,8 +75,6 @@ extern UINT8 *consolebgmap;
extern UINT8 *promptbgmap;
INT32 CON_ShiftChar(INT32 ch);
INT32 CON_ShitAndAltGrChar(INT32 ch);
void CON_SetupBackColormapEx(INT32 color, boolean prompt);
void CON_SetupBackColormap(void);
void CON_ClearHUD(void); // clear heads up messages

View file

@ -162,105 +162,6 @@ char english_shiftxform[] =
'{', '|', '}', '~', 127
};
char french_shiftxform[] =
{
0,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31,
' ','$', //shift-!
'3', //shift-"
'#', '$', '%',
'1', //shift-&
'4', // shift-'
'5', // shift-(
')', // shift-)
'*', '+',
'?', // shift-,
'6', // shift--
'.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9',
'/', // shitf-:
'.', // shift-;
'>', // shift-<
'+', // shift-=
'>', '?', '@',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'[', '\\', ']', '^',
'8', //shift-_
'`',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'{', '|', '}', '~', 127,
128, 129,
'2',
131, 132,
'0',
134,
'9',
136, 137,
'7',
139, 140,
'%'
};
char french_altgrxform[] =
{
0,
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31,
' ', '!',
'#', //altgr-"
'#', '$', '%', '&',
'{', //altgr-'
'[', //altgr-(
']', //altgr-)
'*', '+', ',',
'|', //altg--
'.', '/',
'0', '1', '2', '3', '4', '5',
'6', '7', '8', '9',
':', ';', '<',
'}', //altgr-=
'>', '?', '@',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'[', '\\', ']', '^',
'\\', //altgr-backslash
'`',
'a', 'b', 'c', 'd', 'E', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'{', '|', '}', '~', 127,
128, 129,
'~',
131, 132,
'@',
134,
'^',
136, 137,
'`',
139, 140,
KEY_FR_U_GRAVE
};
//fallback for special letter non displayable in the game (i.e.: 'é','à',etc.)
INT32 HU_FallBackFrSpecialLetter(INT32 key)
{
switch(key){
case KEY_FR_E_AIGUE: return 'e';
case KEY_FR_E_GRAVE: return 'e';
case KEY_FR_C_CEDILLE: return 'c';
case KEY_FR_A_GRAVE: return 'a';
case KEY_FR_U_GRAVE: return 'u';
default: return key;
}
}
static char cechotext[1024];
static tic_t cechotimer = 0;
static tic_t cechoduration = 5*TICRATE;
@ -485,11 +386,6 @@ void HU_Start(void)
headsupactive = true;
}
void HU_Shiftform(void)
{
shiftxform = (cv_keyboardlayout.value == 3) ? french_shiftxform : english_shiftxform;
}
//======================================================================
// EXECUTION
//======================================================================

View file

@ -71,12 +71,6 @@ enum
extern char *shiftxform; // english translation shift table
extern char english_shiftxform[];
extern char french_shiftxform[];
extern char french_altgrxform[];
//fallback for special letter non displayable in the game (i.e.: 'é','à',etc.)
INT32 HU_FallBackFrSpecialLetter(INT32 key);
//------------------------------------
// sorted player lines
//------------------------------------
@ -131,8 +125,6 @@ patch_t *HU_UpdateOrBlankPatch(patch_t **user, boolean required, const char *for
// reset heads up when consoleplayer respawns.
void HU_Start(void);
void HU_Shiftform(void);
boolean HU_Responder(event_t *ev);
void HU_Ticker(void);
void HU_TickSongCredits(void);

View file

@ -3,7 +3,6 @@
#include "v_video.h"
#include "r_main.h" // renderisnewtic
#include "i_system.h"
#include "i_video.h"
#include "keys.h"
#include "console.h"
@ -236,8 +235,8 @@ void M_TextInputSetString(textinput_t *input, const char *c)
static boolean M_TextInputHandleBase(textinput_t *input, INT32 key, boolean emotes)
{
if (key == KEY_LSHIFT || key == KEY_RSHIFT
|| key == KEY_LCTRL || key == KEY_RCTRL
|| key == KEY_LALT || key == KEY_RALT)
|| key == KEY_LCTRL || key == KEY_RCTRL
|| key == KEY_LALT || key == KEY_RALT)
return false;
if (shiftdown && key == KEY_INS)
@ -246,7 +245,8 @@ static boolean M_TextInputHandleBase(textinput_t *input, INT32 key, boolean emot
return true;
}
if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown))
//if ((cv_keyboardlayout.value != 3 && ctrldown) || (cv_keyboardlayout.value == 3 && ctrldown && !altdown))
if (ctrldown)
{
if (key == 'x' || key == 'X')
{
@ -372,17 +372,17 @@ static boolean M_TextInputHandleBase(textinput_t *input, INT32 key, boolean emot
if (key >= KEY_KEYPAD7 && key <= KEY_KPADDEL)
{
char keypad_translation[] = {'7','8','9','-',
'4','5','6','+',
'1','2','3',
'0','.'};
'4','5','6','+',
'1','2','3',
'0','.'};
key = keypad_translation[key - KEY_KEYPAD7];
key = keypad_translation[key - KEY_KEYPAD7];
}
else if (key == KEY_KPADSLASH)
key = '/';
// same capslock code as hu_stuff.c's HU_responder. Check there for details.
key = cv_keyboardlayout.value == 3 ? CON_ShitAndAltGrChar(key) : CON_ShiftChar(key);
key = CON_ShiftChar(key);
// enter a char into the command prompt
if (key < 32 || key > 127)

View file

@ -87,18 +87,8 @@
rendermode_t rendermode = render_soft;
rendermode_t chosenrendermode = render_none; // set by command line arguments
static void KeyboardLayout_OnChange(void)
{
if (!window)
return;
if (cv_keyboardlayout.value != 2)
SDL_StopTextInput(window);
HU_Shiftform();
}
static CV_PossibleValue_t keyboardlayout_cons_t[] = {{1,"Default US"}, {2, "Native"}, {3, "AZERTY"}, {0, NULL}};
consvar_t cv_keyboardlayout = CVAR_INIT ("keyboardlayout", "Default US", CV_SAVE, keyboardlayout_cons_t, KeyboardLayout_OnChange);
consvar_t cv_keyboardlayout = CVAR_INIT ("keyboardlayout", "Default US", CV_SAVE, keyboardlayout_cons_t, NULL);
boolean highcolor = false;