Hotkeys in C++

Posts 1–8 of 8 · Page 1 of 1
Hotkeys in C++
One of the most basic things needed in a trainer, hotkeys to activate or deactivate cheats!

GetAsyncKeyState("A Virtual-Key Here");

GetAsyncKeyState will return true if the key is down and false if it isn't.

List of keys:
http://msdn.microsoft.com/library/de...alkeycodes.asp

Oh yeah you need to include the library "user32.lib"
The RegisterHotkey() function is much more useful and efficient.. because then the program does not need to have the focus in order for the hotkeys to work. and GetASyncKeyState does not support two key combinations like Shift+ G , etc..
Quote Originally Posted by niggas
The RegisterHotkey() function is much more useful and efficient.. because then the program does not need to have the focus in order for the hotkeys to work. and GetASyncKeyState does not support two key combinations like Shift+ G , etc..
True, however GetASyncKeyState can be used for combinations of keys. BTW: Its RegisterHotKey
System wide hotkeys are better because you don't eat up CPU time in a loop to check key state.
Yea, true, but that might interfere with other applications running on your system

system wide hooks in my opinion are not a good thing to practice.
But PowerKeyFunc() works the best IMO.
ty for these i didnt know these before
Quote Originally Posted by Dave84311 View Post
One of the most basic things needed in a trainer, hotkeys to activate or deactivate cheats!

GetAsyncKeyState("A Virtual-Key Here");

GetAsyncKeyState will return true if the key is down and false if it isn't.

List of keys:
http://msdn.microsoft.com/library/de...alkeycodes.asp

Oh yeah you need to include the library "user32.lib"
Dave I love you so much for posting that link :P. Even though I knew most I love the volume up and down keys. Very nice
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?