Page 1 of 1

How to test for 2 key presses

PostPosted: Wed Jun 30, 2004 12:57 am
by Just4Fun
I understand how to check for a Key press, but how would I check for two Key presses?
if (KEY_1 && KEY_2)
do something
:?:
TIA

PostPosted: Wed Jun 30, 2004 11:12 am
by makslane
In a Key Down event, click with right mouse buttom to catch any key.
Add the Script Editor action:

Code: Select all
char *key = GetKeyState();

//Catch a+s keys
if(key[KEY_a] && key[KEY_s])
{
    //Action for a+s
}

//Catch a+d keys
if(key[KEY_a] && key[KEY_d])
{
   //Action for a+d
}

PostPosted: Wed Jun 30, 2004 7:57 pm
by Just4Fun
Thanks Makslane,
That is just what I needed... :lol: