Removed the non-working keyboard hook, and with it, the NOHOOK make parameter.
This commit is contained in:
@@ -297,22 +297,39 @@ TOOL_PREFIX := x86_64-w64-mingw32-
|
|||||||
else
|
else
|
||||||
TOOL_PREFIX := i686-w64-mingw32-
|
TOOL_PREFIX := i686-w64-mingw32-
|
||||||
endif
|
endif
|
||||||
CPP := ${TOOL_PREFIX}g++
|
|
||||||
CC := ${TOOL_PREFIX}gcc
|
|
||||||
WINDRES := windres
|
WINDRES := windres
|
||||||
STRIP := strip
|
STRIP := strip
|
||||||
ifeq ($(ARM64), y)
|
ifeq ($(ARM64), y)
|
||||||
CPP := aarch64-w64-mingw32-g++
|
|
||||||
CC := aarch64-w64-mingw32-gcc
|
|
||||||
WINDRES := aarch64-w64-mingw32-windres
|
WINDRES := aarch64-w64-mingw32-windres
|
||||||
STRIP := aarch64-w64-mingw32-strip
|
STRIP := aarch64-w64-mingw32-strip
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARM), y)
|
ifeq ($(ARM), y)
|
||||||
CPP := armv7-w64-mingw32-g++
|
|
||||||
CC := armv7-w64-mingw32-gcc
|
|
||||||
WINDRES := armv7-w64-mingw32-windres
|
WINDRES := armv7-w64-mingw32-windres
|
||||||
STRIP := armv7-w64-mingw32-strip
|
STRIP := armv7-w64-mingw32-strip
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(CLANG), y)
|
||||||
|
CPP := clang++
|
||||||
|
CC := clang
|
||||||
|
ifeq ($(ARM64), y)
|
||||||
|
CPP := aarch64-w64-mingw32-clang++
|
||||||
|
CC := aarch64-w64-mingw32-clang
|
||||||
|
endif
|
||||||
|
ifeq ($(ARM), y)
|
||||||
|
CPP := armv7-w64-mingw32-clang++
|
||||||
|
CC := armv7-w64-mingw32-clang
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
CPP := ${TOOL_PREFIX}g++
|
||||||
|
CC := ${TOOL_PREFIX}gcc
|
||||||
|
ifeq ($(ARM64), y)
|
||||||
|
CPP := aarch64-w64-mingw32-g++
|
||||||
|
CC := aarch64-w64-mingw32-gcc
|
||||||
|
endif
|
||||||
|
ifeq ($(ARM), y)
|
||||||
|
CPP := armv7-w64-mingw32-g++
|
||||||
|
CC := armv7-w64-mingw32-gcc
|
||||||
|
endif
|
||||||
|
endif
|
||||||
DEPS = -MMD -MF $*.d -c $<
|
DEPS = -MMD -MF $*.d -c $<
|
||||||
DEPFILE := win/.depends
|
DEPFILE := win/.depends
|
||||||
|
|
||||||
@@ -326,15 +343,11 @@ endif
|
|||||||
ifdef EXINC
|
ifdef EXINC
|
||||||
OPTS += -I$(EXINC)
|
OPTS += -I$(EXINC)
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(OPTIM), y)
|
||||||
|
DFLAGS := -march=native
|
||||||
|
else
|
||||||
ifeq ($(X64), y)
|
ifeq ($(X64), y)
|
||||||
ifeq ($(OPTIM), y)
|
|
||||||
DFLAGS := -march=native
|
|
||||||
else
|
|
||||||
DFLAGS :=
|
DFLAGS :=
|
||||||
endif
|
|
||||||
else
|
|
||||||
ifeq ($(OPTIM), y)
|
|
||||||
DFLAGS := -march=native
|
|
||||||
else
|
else
|
||||||
DFLAGS := -march=i686
|
DFLAGS := -march=i686
|
||||||
endif
|
endif
|
||||||
@@ -378,10 +391,6 @@ ifeq ($(VRAMDUMP), y)
|
|||||||
OPTS += -DENABLE_VRAM_DUMP
|
OPTS += -DENABLE_VRAM_DUMP
|
||||||
RFLAGS += -DENABLE_VRAM_DUMP
|
RFLAGS += -DENABLE_VRAM_DUMP
|
||||||
endif
|
endif
|
||||||
ifeq ($(NOHOOK), y)
|
|
||||||
OPTS += -DNO_KEYBOARD_HOOK
|
|
||||||
RFLAGS += -DNO_KEYBOARD_HOOK
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# Optional modules.
|
# Optional modules.
|
||||||
@@ -829,7 +838,7 @@ LIBS += -static
|
|||||||
ifeq ($(AUTODEP), y)
|
ifeq ($(AUTODEP), y)
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
@echo $<
|
@echo $<
|
||||||
@$(CC) $(CFLAGS) $(DEPS) -c $<
|
$(CC) $(CFLAGS) $(DEPS) -c $<
|
||||||
|
|
||||||
%.o: %.cc
|
%.o: %.cc
|
||||||
@echo $<
|
@echo $<
|
||||||
@@ -866,7 +875,9 @@ endif
|
|||||||
|
|
||||||
# Suppress false positive warnings in vid_voodoo_codegen_x86[-64].h
|
# Suppress false positive warnings in vid_voodoo_codegen_x86[-64].h
|
||||||
# that cause ~3000 lines to be output into the logs each time.
|
# that cause ~3000 lines to be output into the logs each time.
|
||||||
|
ifneq ($(CLANG), y)
|
||||||
$(VOODOOOBJ): CFLAGS += -Wstringop-overflow=0
|
$(VOODOOOBJ): CFLAGS += -Wstringop-overflow=0
|
||||||
|
endif
|
||||||
|
|
||||||
all: $(PROG).exe
|
all: $(PROG).exe
|
||||||
|
|
||||||
|
@@ -76,10 +76,6 @@ extern WCHAR wopenfilestring[512];
|
|||||||
|
|
||||||
/* Local data. */
|
/* Local data. */
|
||||||
static wchar_t wTitle[512];
|
static wchar_t wTitle[512];
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
static HHOOK hKeyboardHook;
|
|
||||||
static int hook_enabled = 0;
|
|
||||||
#endif
|
|
||||||
static int manager_wm = 0;
|
static int manager_wm = 0;
|
||||||
static int save_window_pos = 0, pause_state = 0;
|
static int save_window_pos = 0, pause_state = 0;
|
||||||
static int dpi = 96;
|
static int dpi = 96;
|
||||||
@@ -399,42 +395,6 @@ ResetAllMenus(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
static LRESULT CALLBACK
|
|
||||||
LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
BOOL bControlKeyDown;
|
|
||||||
KBDLLHOOKSTRUCT *p;
|
|
||||||
|
|
||||||
if (nCode < 0 || nCode != HC_ACTION ||
|
|
||||||
(!mouse_capture && !video_fullscreen) || (kbd_req_capture && !mouse_capture && !video_fullscreen))
|
|
||||||
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
|
|
||||||
|
|
||||||
p = (KBDLLHOOKSTRUCT*)lParam;
|
|
||||||
|
|
||||||
/* disable alt-tab */
|
|
||||||
if (p->vkCode == VK_TAB && p->flags & LLKHF_ALTDOWN) return(1);
|
|
||||||
|
|
||||||
/* disable alt-space */
|
|
||||||
if (p->vkCode == VK_SPACE && p->flags & LLKHF_ALTDOWN) return(1);
|
|
||||||
|
|
||||||
/* disable alt-escape */
|
|
||||||
if (p->vkCode == VK_ESCAPE && p->flags & LLKHF_ALTDOWN) return(1);
|
|
||||||
|
|
||||||
/* disable windows keys */
|
|
||||||
if((p->vkCode == VK_LWIN) || (p->vkCode == VK_RWIN)) return(1);
|
|
||||||
|
|
||||||
/* checks ctrl key pressed */
|
|
||||||
bControlKeyDown = GetAsyncKeyState(VK_CONTROL)>>((sizeof(SHORT)*8)-1);
|
|
||||||
|
|
||||||
/* disable ctrl-escape */
|
|
||||||
if (p->vkCode == VK_ESCAPE && bControlKeyDown) return(1);
|
|
||||||
|
|
||||||
return(CallNextHookEx(hKeyboardHook, nCode, wParam, lParam));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
win_notify_dlg_open(void)
|
win_notify_dlg_open(void)
|
||||||
{
|
{
|
||||||
@@ -467,10 +427,6 @@ plat_power_off(void)
|
|||||||
run before the main thread is terminated */
|
run before the main thread is terminated */
|
||||||
cycles -= 99999999;
|
cycles -= 99999999;
|
||||||
|
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
KillTimer(hwndMain, TIMER_1SEC);
|
KillTimer(hwndMain, TIMER_1SEC);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
|
|
||||||
@@ -532,26 +488,11 @@ input_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
infocus = 1;
|
infocus = 1;
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
if (! hook_enabled) {
|
|
||||||
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
|
|
||||||
LowLevelKeyboardProc,
|
|
||||||
GetModuleHandle(NULL),
|
|
||||||
0);
|
|
||||||
hook_enabled = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
infocus = 0;
|
infocus = 0;
|
||||||
plat_mouse_capture(0);
|
plat_mouse_capture(0);
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
if (hook_enabled) {
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
hook_enabled = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
@@ -597,12 +538,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
SetTimer(hwnd, TIMER_1SEC, 1000, NULL);
|
SetTimer(hwnd, TIMER_1SEC, 1000, NULL);
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
|
|
||||||
LowLevelKeyboardProc,
|
|
||||||
GetModuleHandle(NULL), 0);
|
|
||||||
hook_enabled = 1;
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
@@ -654,9 +589,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
nvr_save();
|
nvr_save();
|
||||||
config_save();
|
config_save();
|
||||||
}
|
}
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
#endif
|
|
||||||
KillTimer(hwnd, TIMER_1SEC);
|
KillTimer(hwnd, TIMER_1SEC);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
@@ -1125,9 +1057,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
nvr_save();
|
nvr_save();
|
||||||
config_save();
|
config_save();
|
||||||
}
|
}
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
#endif
|
|
||||||
KillTimer(hwnd, TIMER_1SEC);
|
KillTimer(hwnd, TIMER_1SEC);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
@@ -1135,9 +1064,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
#endif
|
|
||||||
KillTimer(hwnd, TIMER_1SEC);
|
KillTimer(hwnd, TIMER_1SEC);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
@@ -1192,9 +1118,6 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
nvr_save();
|
nvr_save();
|
||||||
config_save();
|
config_save();
|
||||||
}
|
}
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
#endif
|
|
||||||
KillTimer(hwnd, TIMER_1SEC);
|
KillTimer(hwnd, TIMER_1SEC);
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
}
|
}
|
||||||
@@ -1224,26 +1147,11 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
infocus = 1;
|
infocus = 1;
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
if (! hook_enabled) {
|
|
||||||
hKeyboardHook = SetWindowsHookEx(WH_KEYBOARD_LL,
|
|
||||||
LowLevelKeyboardProc,
|
|
||||||
GetModuleHandle(NULL),
|
|
||||||
0);
|
|
||||||
hook_enabled = 1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
infocus = 0;
|
infocus = 0;
|
||||||
plat_mouse_capture(0);
|
plat_mouse_capture(0);
|
||||||
#ifndef NO_KEYBOARD_HOOK
|
|
||||||
if (hook_enabled) {
|
|
||||||
UnhookWindowsHookEx(hKeyboardHook);
|
|
||||||
hook_enabled = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATE:
|
||||||
|
Reference in New Issue
Block a user