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++ Send key?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Fri Nov 21, 2008 2:55 am    Post subject: C++ Send key? Reply with quote

I'm trying to find out how to control the keyboard with C++ can anyone help me?
I just want to know if there is a way to take control over the keystrokes like
orders
"press right for 2 seconds"
"press space "
things like that
Back to top
View user's profile Send private message MSN Messenger
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Fri Nov 21, 2008 3:12 am    Post subject: Reply with quote

Assuming you're on Windows: http://msdn.microsoft.com/en-us/library/ms645530.aspx
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Fri Nov 21, 2008 4:40 am    Post subject: Reply with quote

thanks I got what I wanted
my work:


void BOT(){
Sleep(3000);
{

keybd_event(VK_SPACE,0,0 , 0);
keybd_event(VK_SPACE,0, KEYEVENTF_KEYUP,0);//Space
Sleep(90);
keybd_event(0x59,0,0 , 0);
keybd_event(0x59,0, KEYEVENTF_KEYUP,0);//Y
Sleep(90);
keybd_event(VK_UP,0,0 , 0);
keybd_event(VK_UP,0, KEYEVENTF_KEYUP,0);//UP
Sleep(90);
keybd_event(VK_RIGHT,0,0 , 0);
keybd_event(VK_RIGHT,0, KEYEVENTF_KEYUP,0);//Right
Sleep(90);
keybd_event(VK_SPACE,0,0 , 0);
keybd_event(VK_SPACE,0, KEYEVENTF_KEYUP,0);//Space
Sleep(40);
}
}
Back to top
View user's profile Send private message MSN Messenger
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Fri Nov 21, 2008 6:20 am    Post subject: Reply with quote

I'd prefer SendInput over keybd_event. I thought you wanted the user to press your key for like 2 secs. That explains the confusing title.
Back to top
View user's profile Send private message
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