A little help [GetAsyncKeyState]

Posts 1–11 of 11 · Page 1 of 1
A little help [GetAsyncKeyState]
well guys this is my code...

Code:
#include <cstdlib>
#include <iostream>
#include <windows.h>

using namespace std;

int main(int argc, char *argv[])
{
    int i=0;
    while(i<10){
    if(GetAsyncKeyState(VK_LCONTROL))
     if(GetAsyncKeyState(VK_LMENU))
      if(GetAsyncKeyState(VK_NUMPAD1)&1)
    {
       i++;
       cout<<"\I press:  " <<i;
    }
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}
I dont know if its cuz im using DevC++ or what... but i wish to activate something when i press at same time: (left control + left alt + numpad 1)
and it works... but if I press numpad1, and 10sec later press left alt, 20sec later left control works as i pressed (left control + left alt + numpad 1) at same time... dont matter if take 10 or 1 sec...
numpad1, after left alt, after left control == (left control + left alt + numpad 1)

at least in DevC++... there is anyway to write the code to do

if i press (left control + left alt + numpad 1) at same time
do something

TY
Try:
Code:
if(GetAsyncKeyState(VK_LCONTROL) && GetAsyncKeyState(VK_LMENU) && GetAsyncKeyState(VK_NUMPAD1))
{
//do code;
}
this does not work in DevC++... already tried... i dont know why...
well... i think i need to download and instal visual...
ty anyway
Quote Originally Posted by MasterOrc View Post
this does not work in DevC++... already tried... i dont know why...
well... i think i need to download and instal visual...
ty anyway
while(money > 0)
{
if(me != drunk)
{
money--;
beer++;
}
}

seems better
nop...
i buy some beer first b4 check if i am drunk or not..
and if i am to drunk to drink it... i dont know what i do... i just know that i lost all my money
Quote Originally Posted by MasterOrc View Post
nop...
i buy some beer first b4 check if i am drunk or not..
and if i am to drunk to drink it... i dont know what i do... i just know that i lost all my money
if you are too drunk to drink you are also too drunk to buy it
kkkkkkkkkkk
well you dont know how an alcoholic addict brain works
Quote Originally Posted by MasterOrc View Post
kkkkkkkkkkk
well you dont know how an alcoholic addict brain works
lol? come on dude... you are not smashed enough to choose a drink, buy it, and pay. But you are are enough smashed to drink it... kkkkkkkkkkkkkkkkkkkkkkk

/Facepalm...

i guess you are just mad because i changed your algorithm... seems legit.. ^^

so now you added a else so it makes a little more sense? Plus it shouldnt be "beer++", but "drink++"
Get your facts right at least. Now i guess it's enough of offtopic

EDIT:

And about the topic.. It's not a IDE problem... <_<
finally... something about the topic
RSRSRSRSR
ty dude...
well, now is my algorithm signature aproved?
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us