X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=keys.c;h=ea6e2d5985c397392f77eb1563806ad25adde2b2;hb=cee29b1d7d961bbfced617202d03bc29ca78c72a;hp=c76e303f89e1f1e09f687b7e9d5367e896d131f7;hpb=5c92efcb7f6186d225788829268c2e6ecfeeab63;p=xonotic%2Fdarkplaces.git diff --git a/keys.c b/keys.c index c76e303f..ea6e2d59 100644 --- a/keys.c +++ b/keys.c @@ -24,7 +24,7 @@ #include "cl_video.h" #include "utf8lib.h" -cvar_t con_closeontoggleconsole = {CVAR_SAVE, "con_closeontoggleconsole","1", "allows toggleconsole binds to close the console as well"}; +cvar_t con_closeontoggleconsole = {CVAR_SAVE, "con_closeontoggleconsole","1", "allows toggleconsole binds to close the console as well; when set to 2, this even works when not at the start of the line in console input; when set to 3, this works even if the toggleconsole key is the color tag"}; /* key up events are sent even if in console mode @@ -224,7 +224,7 @@ static void Key_History_Find_Backwards(void) for ( ; i >= 0; i--) if (matchpattern_with_separator(ConBuffer_GetLine(&history, i), partial, true, "", false)) { - Con_Printf("^2%*i^7 %s\n", digits, i+1, ConBuffer_GetLine(&history, i)); + Con_Printf("^2%*i^7 %s\n", (int)digits, i+1, ConBuffer_GetLine(&history, i)); history_line = i; history_matchfound = true; return; @@ -255,7 +255,7 @@ static void Key_History_Find_Forwards(void) for ( ; i < CONBUFFER_LINES_COUNT(&history); i++) if (matchpattern_with_separator(ConBuffer_GetLine(&history, i), partial, true, "", false)) { - Con_Printf("^2%*i^7 %s\n", digits, i+1, ConBuffer_GetLine(&history, i)); + Con_Printf("^2%*i^7 %s\n", (int)digits, i+1, ConBuffer_GetLine(&history, i)); history_line = i; history_matchfound = true; return; @@ -277,7 +277,7 @@ static void Key_History_Find_All(void) for (i=0; i 0 && ascii < 32 && utf8_enable.integer) ascii = 0xE000 + ascii; if (chat_bufferlen == sizeof (chat_buffer) - 1) @@ -1472,7 +1502,7 @@ Key_PrintBindList(int j) p = keybindings[j][i]; if (p) { - Cmd_QuoteString(bindbuf, sizeof(bindbuf), p, "\"\\"); + Cmd_QuoteString(bindbuf, sizeof(bindbuf), p, "\"\\", false); if (j == 0) Con_Printf("^2%s ^7= \"%s\"\n", Key_KeynumToString (i), bindbuf); else @@ -1565,7 +1595,7 @@ Key_WriteBindings (qfile_t *f) p = keybindings[j][i]; if (p) { - Cmd_QuoteString(bindbuf, sizeof(bindbuf), p, "\"\\"); // don't need to escape $ because cvars are not expanded inside bind + Cmd_QuoteString(bindbuf, sizeof(bindbuf), p, "\"\\", false); // don't need to escape $ because cvars are not expanded inside bind if (j == 0) FS_Printf(f, "bind %s \"%s\"\n", Key_KeynumToString (i), bindbuf); else @@ -1864,7 +1894,7 @@ Key_Event (int key, int ascii, qboolean down) // con_closeontoggleconsole enables toggleconsole keys to close the // console, as long as they are not the color prefix character // (special exemption for german keyboard layouts) - if (con_closeontoggleconsole.integer && bind && !strncmp(bind, "toggleconsole", strlen("toggleconsole")) && (key_consoleactive & KEY_CONSOLEACTIVE_USER) && ascii != STRING_COLOR_TAG) + if (con_closeontoggleconsole.integer && bind && !strncmp(bind, "toggleconsole", strlen("toggleconsole")) && (key_consoleactive & KEY_CONSOLEACTIVE_USER) && (con_closeontoggleconsole.integer >= ((ascii != STRING_COLOR_TAG) ? 2 : 3) || key_linepos == 1)) { Con_ToggleConsole_f (); return; @@ -1887,7 +1917,10 @@ Key_Event (int key, int ascii, qboolean down) // ignore binds while a video is played, let the video system handle the key event if (cl_videoplaying) { - CL_Video_KeyEvent (key, ascii, keydown[key] != 0); + if (gamemode == GAME_BLOODOMNICIDE) // menu controls key events + MR_KeyEvent(key, ascii, down); + else + CL_Video_KeyEvent (key, ascii, keydown[key] != 0); return; }