X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=keys.c;h=ff8d57860f298bc4780b90a532ee06a72e8f31b5;hp=0168b3f93ee16cd3d76379ab56612f0595ab7865;hb=adf6ed953670cfef7cdc05928435c159f3af228a;hpb=7fb8cfb8d7a076851563e7108d1bd1e1158ec3b6 diff --git a/keys.c b/keys.c index 0168b3f9..ff8d5786 100644 --- a/keys.c +++ b/keys.c @@ -52,6 +52,8 @@ static void Key_History_Init(void) qfile_t *historyfile; ConBuffer_Init(&history, HIST_TEXTSIZE, HIST_MAXLINES, zonemempool); +// not necessary for mobile +#ifndef DP_MOBILETOUCH historyfile = FS_OpenRealFile("darkplaces_history.txt", "rb", false); // rb to handle unix line endings on windows too if(historyfile) { @@ -83,6 +85,7 @@ static void Key_History_Init(void) FS_Close(historyfile); } +#endif history_line = -1; } @@ -91,6 +94,8 @@ static void Key_History_Shutdown(void) { // TODO write history to a file +// not necessary for mobile +#ifndef DP_MOBILETOUCH qfile_t *historyfile = FS_OpenRealFile("darkplaces_history.txt", "w", false); if(historyfile) { @@ -99,6 +104,7 @@ static void Key_History_Shutdown(void) FS_Printf(historyfile, "%s\n", ConBuffer_GetLine(&history, i)); FS_Close(historyfile); } +#endif ConBuffer_Shutdown(&history); } @@ -1842,7 +1848,9 @@ Key_Event (int key, int ascii, qboolean down) if(key_consoleactive & KEY_CONSOLEACTIVE_FORCED) { key_consoleactive &= ~KEY_CONSOLEACTIVE_USER; +#ifdef CONFIG_MENU MR_ToggleMenu(1); +#endif } else Con_ToggleConsole_f(); @@ -1856,14 +1864,18 @@ Key_Event (int key, int ascii, qboolean down) case key_menu: case key_menu_grabbed: +#ifdef CONFIG_MENU MR_KeyEvent (key, ascii, down); +#endif break; case key_game: // csqc has priority over toggle menu if it wants to (e.g. handling escape for UI stuff in-game.. :sick:) q = CL_VM_InputEvent(down ? 0 : 1, key, ascii); +#ifdef CONFIG_MENU if (!q && down) MR_ToggleMenu(1); +#endif break; default: @@ -1931,7 +1943,12 @@ Key_Event (int key, int ascii, qboolean down) if (cl_videoplaying) { if (gamemode == GAME_BLOODOMNICIDE) // menu controls key events +#ifdef CONFIG_MENU MR_KeyEvent(key, ascii, down); +#else + { + } +#endif else CL_Video_KeyEvent (key, ascii, keydown[key] != 0); return; @@ -1946,7 +1963,9 @@ Key_Event (int key, int ascii, qboolean down) break; case key_menu: case key_menu_grabbed: +#ifdef CONFIG_MENU MR_KeyEvent (key, ascii, down); +#endif break; case key_game: q = CL_VM_InputEvent(down ? 0 : 1, key, ascii);