Hi There,
I thought this must have been asked many times. I use something like:
I could disable mouse events but MENU_EVENT 0x0008 and FOCUS_EVENT 0x0010 keep coming.
How can I get rid of those - I cannot see an option in SetConsoleMode;
Thank you :)
I thought this must have been asked many times. I use something like:
Code:
static HANDLE stdinHandle = GetStdHandle(STD_INPUT_HANDLE);
const DWORD consoleInputCommandMode = ENABLE_ECHO_INPUT + ENABLE_PROCESSED_INPUT;
SetConsoleMode(stdinHandle, consoleInputCommandMode);
FlushConsoleInputBuffer(stdinHandle);
INPUT_RECORD record;
DWORD numRead;
switch (WaitForSingleObject(stdinHandle, 1000)) {
case(WAIT_OBJECT_0):
if (ReadConsoleInput(stdinHandle, &record, 1, &numRead)) {
if (record.EventType != KEY_EVENT) {
// THIS IS THE PROBLEM, I just want key events, nothing else
}
}
break;
}How can I get rid of those - I cannot see an option in SetConsoleMode;
Thank you :)