diff options
-rw-r--r-- | console.c | 1 | ||||
-rw-r--r-- | console.h | 3 | ||||
-rw-r--r-- | main_gui.c | 4 | ||||
-rw-r--r-- | win32.c | 13 |
4 files changed, 13 insertions, 8 deletions
@@ -32,7 +32,6 @@ static char* _iconsole_buffer[ICON_BUFFER + 1]; static uint16 _iconsole_cbuffer[ICON_BUFFER + 1]; static char _iconsole_cmdline[ICON_CMDLN_SIZE]; static byte _iconsole_cmdpos; -static Window* _iconsole_win = NULL; static byte _iconsole_scroll; // ** console cursor ** // @@ -1,6 +1,9 @@ #ifndef CONSOLE_H #define CONSOLE_H +/* Pointer to console window */ +VARDEF Window *_iconsole_win; + // ** console parser ** // typedef enum _iconsole_var_types { diff --git a/main_gui.c b/main_gui.c index 6fac303a3..3a754e69b 100644 --- a/main_gui.c +++ b/main_gui.c @@ -2202,7 +2202,7 @@ static void StatusBarWndProc(Window *w, WindowEvent *e) } } -void ScrollMainViewport(int x, int y) +static void ScrollMainViewport(int x, int y) { if (_game_mode != GM_MENU) { Window *w = FindWindowById(WC_MAIN_WINDOW, 0); @@ -2250,7 +2250,7 @@ static const int8 scrollamt[16][2] = { void HandleKeyScrolling(void) { - if (_dirkeys) { + if (_dirkeys && _iconsole_win == NULL) { int factor = _shift_pressed ? 50 : 10; ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor); } @@ -714,11 +714,14 @@ static int Win32GdiMainLoop(void) _dbg_screen_rect = _wnd.has_focus && GetAsyncKeyState(VK_CAPITAL)<0; // determine which directional keys are down - _dirkeys = - (GetAsyncKeyState(VK_LEFT) < 0 ? 1 : 0) + - (GetAsyncKeyState(VK_UP) < 0 ? 2 : 0) + - (GetAsyncKeyState(VK_RIGHT) < 0 ? 4 : 0) + - (GetAsyncKeyState(VK_DOWN) < 0 ? 8 : 0); + if (_wnd.has_focus) { + _dirkeys = + (GetAsyncKeyState(VK_LEFT) < 0 ? 1 : 0) + + (GetAsyncKeyState(VK_UP) < 0 ? 2 : 0) + + (GetAsyncKeyState(VK_RIGHT) < 0 ? 4 : 0) + + (GetAsyncKeyState(VK_DOWN) < 0 ? 8 : 0); + } else + _dirkeys = 0; GameLoop(); _cursor.delta.x = _cursor.delta.y = 0; |