mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-30 06:32:36 +00:00
Don't install the global keyboard hook if we're running in pure console
mode.
This commit is contained in:
parent
697e27d2e3
commit
c5f227ab1a
@ -124,9 +124,10 @@ LRESULT CALLBACK ShellProc(int code, WPARAM wParam, LPARAM lParam) {
|
||||
}
|
||||
|
||||
void installHook() {
|
||||
/* note: don't install the hook if we're debugging, otherwise inptuts
|
||||
get SUPER laggy. */
|
||||
if (!IsDebuggerPresent() && !::hook) {
|
||||
/* note: don't install the hook if we're debugging or running as a true console
|
||||
app, otherwise inputs get SUPER laggy. */
|
||||
bool isConsoleApp = GetConsoleWindow() != nullptr;
|
||||
if (!isConsoleApp && !IsDebuggerPresent() && !::hook) {
|
||||
hook = SetWindowsHookEx(WH_KEYBOARD_LL, (HOOKPROC)ShellProc, module, 0L);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user