SolvedHot Keys And Values

Posts 15 of 5 · Page 1 of 1
Hot Keys And Values
Very much appreciated in advanced for any help,

I would like to make a C++ .dll function for below condition:

example there is an address 00800000 which default value is 0x00

if I press F3 hotkey (1st time) - it will change the default value into 0x01

if I press F3 hotkey (2nd time) - it will change the default value into 0x02

if I press F3 hotkey (3rd time) - it will change the default value into 0x03

if I press F3 hotkey (4th time) - it will change back the default value into its original 0x00

Thank you~
Code:
int count = 0;
if (GetAsyncKeyState(VK_F3))
{	
	switch(count)
	{
		case 0: *(int*)0x00800000 = 0x00; count = 1;break;
		case 1: *(int*)0x00800000 = 0x01; count = 2;break;
		case 2: *(int*)0x00800000 = 0x02; count = 3;break;
		case 3: *(int*)0x00800000 = 0x03; count = 0;break;
	}
}
I have NO idea if this is the best way.
Code:
int count = 0;
while(true){
    if(GetAsyncKeyState(VK_F3)){
       *(int*)0x00800000 = count;
       count++;
    }
    if(count>3) count = 0;
}
Not sure if it works...
Marked solved. No more posting unless required by the original poster.
Posts 15 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?