Hotkeys

Posts 1–5 of 5 · Page 1 of 1
Hotkeys
Hello,


I made an autoclicker for a game called "Crosfire" it is a FPS.


The problem is that while in game when I start the virtual keys pressing it doesn't work at all in game. The autoclicker works fine because I test it clicking numbers in a calculator, but does not work in game.



Now can I make it to work in game?




Thanks in advance!
Im new to C++ but..
I tried to make hotkeys, and worked..i did this:

Code:
#include <Windows.h>
#include <iostream>

int main() {

start:

if(GetAsyncKeyState(123)) {
std::cout << "You pressed F12!" << std::endl;
system("cls"); }

goto start;

}
It works pretty good, Idk if this is what you want but..I tried..
Quote Originally Posted by Lyoto Machida View Post
Im new to C++ but..
I tried to make hotkeys, and worked..i did this:

Code:
#include <Windows.h>
#include <iostream>

int main() {

start:

if(GetAsyncKeyState(123)) {
std::cout << "You pressed F12!" << std::endl;
system("cls"); }

goto start;

}
It works pretty good, Idk if this is what you want but..I tried..
Thanks! but I found the way I want it. Now I have a new question.
Quote Originally Posted by Dontpatchlvl2 View Post
Thanks! but I found the way I want it. Now I have a new question.
Ok..Good luck
....
Crossfire blocks sendkeys and getasynkeystate and mutch other shiit..
Quote Originally Posted by Dontpatchlvl2 View Post
Hello,


I made an autoclicker for a game called "Crosfire" it is a FPS.


The problem is that while in game when I start the virtual keys pressing it doesn't work at all in game. The autoclicker works fine because I test it clicking numbers in a calculator, but does not work in game.



Now can I make it to work in game?




Thanks in advance!
This should work. Call this function whenever you want to simulate mouse click and release.
Code:
void LeftClick( )
{  
    INPUT input = { 0 };
    input.type = INPUT_MOUSE;
    input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
    ::SendInput(1, &input, sizeof(INPUT));

    ::ZeroMemory(&input, sizeof(INPUT));
    input.type = INPUT_MOUSE;
    input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
    ::SendInput(1, &input, sizeof(INPUT));
}
Credits to google
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us