Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++] How to make code send a keyboard or mouse output?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
The Dab
Cheater
Reputation: 0

Joined: 22 May 2017
Posts: 25

PostPosted: Sat Sep 02, 2017 7:56 pm    Post subject: [C++] How to make code send a keyboard or mouse output? Reply with quote

Example of what I am trying to do:

Code:

if (crosshairID is == 16)
{
Sendinput(LeftClick);
}


Anyone know how to do something like this?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 137

Joined: 25 Jan 2006
Posts: 7309
Location: 127.0.0.1

PostPosted: Sat Sep 02, 2017 8:15 pm    Post subject: Reply with quote

You have the general function used for external key input in your pseudo code already. Just look at the docs for it to learn how to use it properly:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx

This method will not work on all games though.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
The Dab
Cheater
Reputation: 0

Joined: 22 May 2017
Posts: 25

PostPosted: Sun Sep 03, 2017 11:13 am    Post subject: Reply with quote

atom0s wrote:
You have the general function used for external key input in your pseudo code already. Just look at the docs for it to learn how to use it properly:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx

This method will not work on all games though.


I am not seeming to understand the MSDN page. Can you give me an example of how you would use SendInput?
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 137

Joined: 25 Jan 2006
Posts: 7309
Location: 127.0.0.1

PostPosted: Mon Sep 04, 2017 6:57 pm    Post subject: Reply with quote

I don't personally use it so I don't have any examples readily available from personal projects, but there are plenty of examples via Google.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites