mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-12-03 17:42:40 +00:00
azerty kb patch from Filip Van Raemdonck <mechanix@digibel.org>. includes some
misc fixes, too
This commit is contained in:
parent
edcc313501
commit
46176e1094
7 changed files with 66 additions and 9 deletions
|
@ -159,6 +159,13 @@ typedef enum {
|
|||
K_MWHEELUP,
|
||||
K_MWHEELDOWN,
|
||||
|
||||
K_ASC178,
|
||||
K_ASC233,
|
||||
K_ASC167,
|
||||
K_ASC232,
|
||||
K_ASC231,
|
||||
K_ASC224,
|
||||
|
||||
// keys count
|
||||
K_NUM_KEYS,
|
||||
} keynum_t;
|
||||
|
|
|
@ -525,7 +525,7 @@ Cmd_TokenizeString (const char *text)
|
|||
memset (cmd_args, 0, sizeof (cmd_args));
|
||||
|
||||
while (1) {
|
||||
// skip whitespace up to a /n
|
||||
// skip whitespace up to a \n
|
||||
while (*text && *(unsigned char *) text <= ' ' && *text != '\n') {
|
||||
text++;
|
||||
}
|
||||
|
|
|
@ -894,7 +894,7 @@ static void Usage(void)
|
|||
* Main Routine
|
||||
*/
|
||||
|
||||
int fbset_main(int argc, char *argv[])
|
||||
int fbset_main(int argc, const char *argv[])
|
||||
{
|
||||
struct VideoMode *vmode;
|
||||
struct fb_var_screeninfo var;
|
||||
|
|
|
@ -285,6 +285,26 @@ XLateKey (XKeyEvent * ev, qboolean modified)
|
|||
key = K_PGDN;
|
||||
break;
|
||||
|
||||
/* Some high ASCII symbols, for azerty keymaps */
|
||||
case XK_twosuperior:
|
||||
key = K_ASC178;
|
||||
break;
|
||||
case XK_eacute:
|
||||
key = K_ASC233;
|
||||
break;
|
||||
case XK_section:
|
||||
key = K_ASC167;
|
||||
break;
|
||||
case XK_egrave:
|
||||
key = K_ASC232;
|
||||
break;
|
||||
case XK_ccedilla:
|
||||
key = K_ASC231;
|
||||
break;
|
||||
case XK_agrave:
|
||||
key = K_ASC224;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (keysym < 128) {
|
||||
/* ASCII keys */
|
||||
|
|
|
@ -157,7 +157,7 @@ D_EndDirectRect (int x, int y, int width, int height)
|
|||
static void
|
||||
VID_DescribeMode_f (void)
|
||||
{
|
||||
char *modestr;
|
||||
const char *modestr;
|
||||
struct VideoMode *vmode;
|
||||
|
||||
modestr = Cmd_Argv(1);
|
||||
|
@ -207,13 +207,13 @@ VID_NumModes_f (void)
|
|||
|
||||
int VID_SetMode (char *name, unsigned char *palette);
|
||||
|
||||
extern void fbset_main (int argc, char **argv);
|
||||
extern void fbset_main (int argc, const char **argv);
|
||||
|
||||
static void
|
||||
VID_fbset_f (void)
|
||||
{
|
||||
int i, argc;
|
||||
char *argv[32];
|
||||
const char *argv[32];
|
||||
|
||||
argc = Cmd_Argc();
|
||||
if (argc > 32)
|
||||
|
@ -341,7 +341,7 @@ VID_SetPalette (byte * palette)
|
|||
}
|
||||
|
||||
int
|
||||
VID_SetMode (char *name, unsigned char *palette)
|
||||
VID_SetMode (const char *name, unsigned char *palette)
|
||||
{
|
||||
struct VideoMode *vmode;
|
||||
struct fb_var_screeninfo var;
|
||||
|
@ -461,7 +461,7 @@ VID_Init (unsigned char *palette)
|
|||
{
|
||||
int w, h, d;
|
||||
struct VideoMode *vmode;
|
||||
char *modestr;
|
||||
const char *modestr;
|
||||
char *fbname;
|
||||
|
||||
// plugin_load("in_fbdev.so");
|
||||
|
|
|
@ -194,6 +194,13 @@ keyname_t keynames[] = {
|
|||
{"MWHEELUP", K_MWHEELUP},
|
||||
{"MWHEELDOWN", K_MWHEELDOWN},
|
||||
|
||||
{"ASC178", K_ASC178}, /* be azerty keycodes for top row */
|
||||
{"ASC233", K_ASC233},
|
||||
{"ASC167", K_ASC167},
|
||||
{"ASC232", K_ASC232},
|
||||
{"ASC231", K_ASC231},
|
||||
{"ASC224", K_ASC224},
|
||||
|
||||
{"SEMICOLON", ';'}, // because a raw semicolon seperates commands
|
||||
|
||||
{NULL, 0}
|
||||
|
@ -396,8 +403,12 @@ Key_Console (int key)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (key < 32 || key > 127)
|
||||
if (key < 32)
|
||||
return; // non printable
|
||||
if (key > 127 && key != K_ASC178 && key != K_ASC233 && key != K_ASC167 && key != K_ASC232 && key != K_ASC231 && key != K_ASC224) {
|
||||
//Con_Printf ("keysym: %d\n", key);
|
||||
return;
|
||||
}
|
||||
|
||||
i = strlen (key_lines[edit_line]);
|
||||
if (i >= MAXCMDLINE - 1)
|
||||
|
@ -729,6 +740,10 @@ Key_Event (int key, int alt_key, qboolean down)
|
|||
|
||||
// Con_Printf ("%i : %i\n", key, down); //@@@
|
||||
|
||||
/* Let azerty keymaps get to the numbers in console & messagemode etc. */
|
||||
if (key >= 200 && key_dest != key_game && alt_key >= 0x30 && alt_key <= 0x39)
|
||||
key = alt_key;
|
||||
|
||||
// They don't prove it, fall back to interal MESS.
|
||||
if (alt_key == -1) {
|
||||
if (keydown[K_SHIFT]) {
|
||||
|
|
|
@ -195,6 +195,13 @@ keyname_t keynames[] = {
|
|||
{"MWHEELUP", K_MWHEELUP},
|
||||
{"MWHEELDOWN", K_MWHEELDOWN},
|
||||
|
||||
{"ASC178", K_ASC178}, /* be azerty keycodes for top row */
|
||||
{"ASC233", K_ASC233},
|
||||
{"ASC167", K_ASC167},
|
||||
{"ASC232", K_ASC232},
|
||||
{"ASC231", K_ASC231},
|
||||
{"ASC224", K_ASC224},
|
||||
|
||||
{"SEMICOLON", ';'}, // because a raw semicolon seperates commands
|
||||
|
||||
{NULL, 0}
|
||||
|
@ -397,8 +404,12 @@ Key_Console (int key)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (key < 32 || key > 127)
|
||||
if (key < 32)
|
||||
return; // non printable
|
||||
if (key > 127 && key != K_ASC178 && key != K_ASC233 && key != K_ASC167 && key != K_ASC232 && key != K_ASC231 && key != K_ASC224) {
|
||||
//Con_Printf ("keysym: %d\n", key);
|
||||
return;
|
||||
}
|
||||
|
||||
i = strlen (key_lines[edit_line]);
|
||||
if (i >= MAXCMDLINE - 1)
|
||||
|
@ -730,6 +741,10 @@ Key_Event (int key, int alt_key, qboolean down)
|
|||
|
||||
// Con_Printf ("%i : %i\n", key, down); //@@@
|
||||
|
||||
/* Let azerty keymaps get to the numbers in console & messagemode etc. */
|
||||
if (key >= 200 && key_dest != key_game && alt_key >= 0x30 && alt_key <= 0x39)
|
||||
key = alt_key;
|
||||
|
||||
// They don't prove it, fall back to interal MESS.
|
||||
if (alt_key == -1) {
|
||||
if (keydown[K_SHIFT]) {
|
||||
|
|
Loading…
Reference in a new issue