diff --git a/include/QF/keys.h b/include/QF/keys.h index cba143bdb..1fb9c5390 100644 --- a/include/QF/keys.h +++ b/include/QF/keys.h @@ -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; diff --git a/libs/util/cmd.c b/libs/util/cmd.c index 5981059b3..83fb6a566 100644 --- a/libs/util/cmd.c +++ b/libs/util/cmd.c @@ -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++; } diff --git a/libs/video/targets/fbset.c b/libs/video/targets/fbset.c index 582152f4d..723ca883c 100644 --- a/libs/video/targets/fbset.c +++ b/libs/video/targets/fbset.c @@ -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; diff --git a/libs/video/targets/in_x11.c b/libs/video/targets/in_x11.c index 0c88a2e40..2eefe66eb 100644 --- a/libs/video/targets/in_x11.c +++ b/libs/video/targets/in_x11.c @@ -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 */ diff --git a/libs/video/targets/vid_fbdev.c b/libs/video/targets/vid_fbdev.c index d374b7ce2..8fb767521 100644 --- a/libs/video/targets/vid_fbdev.c +++ b/libs/video/targets/vid_fbdev.c @@ -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"); diff --git a/nq/source/keys.c b/nq/source/keys.c index 28d213b7e..fe0d202e1 100644 --- a/nq/source/keys.c +++ b/nq/source/keys.c @@ -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]) { diff --git a/qw/source/keys.c b/qw/source/keys.c index 182908cbd..66fd926aa 100644 --- a/qw/source/keys.c +++ b/qw/source/keys.c @@ -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]) {