Thread: Hotkeys in C++

Results 1 to 8 of 8
  1. #1
    Dave84311's Avatar
    Join Date
    Dec 2005
    Gender
    male
    Location
    The Wild Wild West
    Posts
    35,837
    Reputation
    5782
    Thanks
    41,292
    My Mood
    Devilish

    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:
    https://msdn.microsof*****m/library/de...alkeycodes.asp

    Oh yeah you need to include the library "user32.lib"





    THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE


    "First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311

    HAVING VIRTUAL DETOX

  2. #2
    niggas's Avatar
    Join Date
    Dec 2005
    Posts
    4
    Reputation
    10
    Thanks
    0
    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..

  3. #3
    Dave84311's Avatar
    Join Date
    Dec 2005
    Gender
    male
    Location
    The Wild Wild West
    Posts
    35,837
    Reputation
    5782
    Thanks
    41,292
    My Mood
    Devilish
    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





    THE EYE OF AN ADMINISTRATOR IS UPON YOU. ANY WRONG YOU DO IM GONNA SEE, WHEN YOU'RE ON MPGH, LOOK BEHIND YOU, 'CAUSE THATS WHERE IM GONNA BE


    "First they ignore you. Then they laugh at you. Then they fight you. Then you lose.” - Dave84311

    HAVING VIRTUAL DETOX

  4. #4
    shercipher's Avatar
    Join Date
    Dec 2005
    Posts
    108
    Reputation
    10
    Thanks
    14
    System wide hotkeys are better because you don't eat up CPU time in a loop to check key state.

  5. #5
    niggas's Avatar
    Join Date
    Dec 2005
    Posts
    4
    Reputation
    10
    Thanks
    0
    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.

  6. #6
    arunforce's Avatar
    Join Date
    Dec 2005
    Gender
    male
    Location
    A place for amigos
    Posts
    24,704
    Reputation
    4747
    Thanks
    12,562
    My Mood
    Yeehaw
    But PowerKeyFunc() works the best IMO.



    BRING BACK BT, BRING BACK SAGA, BRING BACK VF, BRING BACK MPGHCRAFT, BRING BACK HABAMON


  7. #7
    somethingwitty's Avatar
    Join Date
    Aug 2007
    Gender
    male
    Location
    A place far far away... Next door.
    Posts
    315
    Reputation
    10
    Thanks
    12
    ty for these i didnt know these before

  8. #8
    fufu's Avatar
    Join Date
    Mar 2007
    Posts
    10
    Reputation
    10
    Thanks
    0
    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:
    https://msdn.microsof*****m/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

Similar Threads

  1. vb hotkeys
    By cjg333 in forum General Game Hacking
    Replies: 7
    Last Post: 07-23-2008, 01:08 PM
  2. My hack release hotkey v1
    By purenoob134 in forum WarRock - International Hacks
    Replies: 23
    Last Post: 07-13-2007, 07:56 PM
  3. a pic of my ingame hotkeys(releasing soon)
    By cjg333 in forum WarRock - International Hacks
    Replies: 2
    Last Post: 07-09-2007, 03:48 AM
  4. Hotkeys for a VB trainer
    By scooby107 in forum Visual Basic Programming
    Replies: 10
    Last Post: 07-03-2007, 12:43 PM
  5. [Tutorial] How To Mack HotKeys On VB
    By TheRedEye in forum WarRock - International Hacks
    Replies: 32
    Last Post: 06-23-2007, 10:24 PM