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 


can CE send keys to 3d games?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Fri Dec 06, 2019 10:36 am    Post subject: can CE send keys to 3d games? Reply with quote

doKeyPress()
KeyUp()
KeyDown()
none of these can send keys to 3d games like csgo or other
only mouse_event() works but thats only for mouse how can i send keys to game

_________________
hi
Back to top
View user's profile Send private message
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Tue Dec 10, 2019 12:09 pm    Post subject: Reply with quote

no one knows?
_________________
hi
Back to top
View user's profile Send private message
SEKTION
Cheater
Reputation: 0

Joined: 05 Nov 2017
Posts: 39
Location: Behind the keyboard

PostPosted: Wed Dec 11, 2019 11:57 pm    Post subject: Reply with quote

I'm also looking for the same
But the methods cheat engine state for key presses don't work
These are simple methods and I don't know any advanced method
So my knowledge is we have to use some other language like python or some advanced method in lua

_________________
TH3 UND3N14BL3
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Dec 12, 2019 2:19 am    Post subject: Reply with quote

Not all games accept input in the same manner. There are various ways input can be handled by an application/game, the methods exposed by Cheat Engine are just a very basic means of attempting to send input to another window.

doKeyPress, keyUp, and keyDown in CE call keybd_event which is a wrapper around 'NtUserSendInput'. Using SendInput with DirectInput, for example, requires additional setup/adjustments to the params passed to the API. The way CE calls it at the moment does not adjust the parameters properly for that instance.

There is also games that take input from the window message handler from messages such as:
- WM_CHAR
- WM_KEYDOWN
- WM_KEYUP

SendInput will not work with these messages.

Another method is via RawInput commands. Most games that use RawInput generally only use it for mouse input or controllers, but keyboard is able to be done via it as well.

For CE related scripts, ideally it would be useful if Dark Byte could add support for custom params added to doKeyPress/keyUp/keyDown to adjust the params of SendInput calls. Up to him ultimately to add it or you can make a pull request on GitHub with the proper adjustments to not break the current API layout while adding more functionality.
https://github.com/cheat-engine/cheat-engine/blob/d88d63a5a7d2b839a403b3c412091ad91e17db43/Cheat%20Engine/LuaHandler.pas#L3047

For DirectInput, if using SendInput you need to adjust the flags passed to include 'KEYEVENTF_SCANCODE'. The key id will then become the proper DirectInput key id instead of the VK code.

(One last thing to keep in mind with this, using API such as SendInput does mark the key as injected. So certain games that monitor for external input for cheating can tell the API call was used.)

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Thu Dec 12, 2019 11:37 am    Post subject: Reply with quote

so can we send DirectInput with vanilla CE?
_________________
hi
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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