Open OverMalo opened 6 years ago
GaInput requires using HWND through WinAPI to work with a keyboard/mouse etc. So, if you want to monitorize the keyboard in console you may take a look at this: Detect function keys in c++ console.
One thing you could try is you can create a native windows application (something that starts with a WinMain and get's a handle passed in right away) but don't create a native win form window. Instead you can create a Console window with AllocConsole.
#include <iostream>
#include <windows.h>
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, INT) {
if (AllocConsole())
{
freopen("CONOUT$", "wt", stdout);
freopen("CONIN$", "rt", stdin);
SetConsoleTitle(L"Debug Console");
std::ios::sync_with_stdio(1);
}
std::cout << "Hello\n" << std::endl;
return 0;
}
Ok forget it. I assumed you need a HINSTANCe to get access to the window, but you need a HWND handle. I couldnt find a way to get a handle. for the console...
Hi,
I want to use your library to monitorize the keyboard on console application (without windows). is it possible or is it compulsory to have a HWND?
Regards,