• WIN API Multiple key detection?
    2 replies, posted
I've been puzzled with this for a while, and I can't seem to find any help from Google. I'm trying to detect key input for multiple keys for the entire system using the WIN API. What I mean by the entire system, is that right now I'm using GetAsyncKeyState(), so it'll work an any screen, any window, and whatever. But it cant seem to handle more than one input. So I hoping someone knows a good way to detect multiple key inputs or maybe a good link to explain it? Oh, I also program in C++, I'm not sure if that will make a big difference since I'm using an API but who knows. Many thanks in advanced. :)
[QUOTE=xAustechx;22155865]I've been puzzled with this for a while, and I can't seem to find any help from Google. I'm trying to detect key input for multiple keys for the entire system using the WIN API. What I mean by the entire system, is that right now I'm using GetAsyncKeyState(), so it'll work an any screen, any window, and whatever. But it cant seem to handle more than one input. So I hoping someone knows a good way to detect multiple key inputs or maybe a good link to explain it? Oh, I also program in C++, I'm not sure if that will make a big difference since I'm using an API but who knows. Many thanks in advanced. :)[/QUOTE] if(GetAsyncKeyState(blah) && GetAsyncKeyState(blahblahblah)) { } Would that work? [editline]09:28PM[/editline] or maybe [cpp] while(GetAsyncKeyState(key1)) { if(GetAsyncKeyState(key2)) { // do stuff } } [/cpp]
[QUOTE=raccoon12;22155925]if(GetAsyncKeyState(blah) && GetAsyncKeyState(blahblahblah)) { } Would that work? [editline]09:28PM[/editline] or maybe [cpp] while(GetAsyncKeyState(key1)) { if(GetAsyncKeyState(key2)) { // do stuff } } [/cpp][/QUOTE] Oh my god. Guys I'm really sorry, I realize what I was doing wrong. Basically I was trying to make something simple with spare time to move the mouse with keys. But I forgot to update the Mouse position when you press a key, so it seemed like nothing was happening. Sorry to waste your time, and yes raccoon, that would work. Really sorry again guys. :/
Sorry, you need to Log In to post a reply to this thread.