Hotkeys super sensitive?

Posts 113 of 13 · Page 1 of 1
Hotkeys super sensitive?
If I go ingame and try to activate chams or boxes, the keys are super sensitive and when I press the hotkey it switches from off to on and so forth very rapidly. So I was wondering if there is a way to fix this, or is it just my keyboard that is doing this?

Code:
#include <windows.h>
#include <time.h> 
bool chams = false;
bool hack = false; 
bool Memoria( void * pDest, char * szPatch, size_t sSize )//NOP Function
{ 
    DWORD dwOrgProtect = NULL; 
    if ( !VirtualProtect ( pDest, sSize, PAGE_EXECUTE_READWRITE, &dwOrgProtect ))
        return FALSE;

    memcpy( pDest, szPatch, sSize ); 
    VirtualProtect( pDest, sSize, dwOrgProtect, NULL ); 
    return TRUE; 
}  
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
 void __cdecl ConsolePush(char* sVal)
{
    DWORD zAddress = 0x007D9200;
    void* szConsole = (void*)*(DWORD*)(zAddress);
    _asm
    {
        push sVal
        call szConsole
        add esp, 4
    }
}
void main() {
while(true) {
if(GetAsyncKeyState(VK_NUMPAD0) < 0){
    hack = !hack;
    if(hack){
        ConsolePush("SkelModelStencil 1"); //Nx Chams On
    } else {
        ConsolePush("SkelModelStencil 0"); //Nx Chams Off
	}
Sleep(100);
}
}
}
DWORD WINAPI dwHackThread(LPVOID)
{
while( !IsGameReadyForHook() )
Sleep(100);
main();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
}
return TRUE;
}
Make it 400 ms instead of 100 when you press the key.
Your code is this; (Noob C&P'er)

if(GetAsyncKeyState(VK_NUMPAD0) < 0){
hack = !hack;
if(hack){
ConsolePush("SkelModelStencil 1"); //Nx Chams On
} else {
ConsolePush("SkelModelStencil 0"); //Nx Chams Off
}

Make it;

if(GetAsyncKeyState(VK_NUMPAD0) < 0 )
//Panic Key
{
hack = !hack;
if(hack)
{
ConsolePush("SkelModelStencil 0"); //Nx Chams Off
//Add More Codes if you want.
}

}

then after that;

if(GetAsyncKeyState(VK_NUMPAD1) < 0 )
//NX Chams
{
hack = !hack;
if(hack)
{
ConsolePush("SkelModelStencil 1"); //Nx Chams On
}

}
Quote Originally Posted by Reap3r2 View Post
Your code is this; (Noob C&P'er)

if(GetAsyncKeyState(VK_NUMPAD0) < 0){
hack = !hack;
if(hack){
ConsolePush("SkelModelStencil 1"); //Nx Chams On
} else {
ConsolePush("SkelModelStencil 0"); //Nx Chams Off
}

Make it;

if(GetAsyncKeyState(VK_NUMPAD0) < 0 )
//Panic Key
{
hack = !hack;
if(hack)
{
ConsolePush("SkelModelStencil 0"); //Nx Chams Off
//Add More Codes if you want.
}

}

then after that;

if(GetAsyncKeyState(VK_NUMPAD1) < 0 )
//NX Chams
{
hack = !hack;
if(hack)
{
ConsolePush("SkelModelStencil 1"); //Nx Chams On
}

}
Why would he do that... that is a terrible idea. It just adds more hotkeys.
Quote Originally Posted by Reap3r2 View Post
Your code is this; (Noob C&P'er)

if(GetAsyncKeyState(VK_NUMPAD0) < 0){
hack = !hack;
if(hack){
ConsolePush("SkelModelStencil 1"); //Nx Chams On
} else {
ConsolePush("SkelModelStencil 0"); //Nx Chams Off
}

Make it;

if(GetAsyncKeyState(VK_NUMPAD0) < 0 )
//Panic Key
{
hack = !hack;
if(hack)
{
ConsolePush("SkelModelStencil 0"); //Nx Chams Off
//Add More Codes if you want.
}

}

then after that;

if(GetAsyncKeyState(VK_NUMPAD1) < 0 )
//NX Chams
{
hack = !hack;
if(hack)
{
ConsolePush("SkelModelStencil 1"); //Nx Chams On
}

}
There is exactly a lot more to my original code, so don't call me a Noob C+P'er until you see the original thing ok? Which you probably won't. The code in the first post is just a example of my problem.
add a Sleep timer in each hotkey
So.. He Can still do it, but i understand your point, if he uses your way, he can add more features.
Guys...
Code:
if(GetAsyncKeyState(VK_NUMPAD0)&1
The &1 will use the LSB(Least Significant Bit). Essentially, once its picked up and called, the key is released. Prevents it from being super sensitive.

Please, do not use a sleep or anything otherwise. That is a redneck fix.

Any hoo, good luck.
Quote Originally Posted by Revolvium View Post
Guys...
Code:
if(GetAsyncKeyState(VK_NUMPAD0)&1
The &1 will use the LSB(Least Significant Bit). Essentially, once its picked up and called, the key is released. Prevents it from being super sensitive.

Please, do not use a sleep or anything otherwise. That is a redneck fix.

Any hoo, good luck.
Sleeping helps you grow though.
Quote Originally Posted by Crash View Post
Sleeping helps you grow though.
Actually, I'm a bit upset now. They are calling each other cpers without realizing that they themselves don't understand the basics of C++
=\

But yeah, the &1 is the most efficient way to do this
Quote Originally Posted by Revolvium View Post
Actually, I'm a bit upset now. They are calling each other cpers without realizing that they themselves don't understand the basics of C++
=\

But yeah, the &1 is the most efficient way to do this
vouch this. tried looking it up in c++ for dummies and couldnt find it, so i had spent a few hours surfing the web looking for explinations of GetAsyncKeyState. its a lot more simple than i thought.
Quote Originally Posted by Revolvium View Post
Actually, I'm a bit upset now. They are calling each other cpers without realizing that they themselves don't understand the basics of C++
=\

But yeah, the &1 is the most efficient way to do this
I guess that would be better. I just use the things that work for me and don't really change them. /
Question has been solved
/Closed
Posts 113 of 13 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?