| View previous topic :: View next topic |
| Author |
Message |
exohaxor Expert Cheater
Reputation: 1
Joined: 02 Sep 2018 Posts: 101
|
Posted: Fri Dec 06, 2019 10:36 am Post subject: can CE send keys to 3d games? |
|
|
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 |
|
 |
exohaxor Expert Cheater
Reputation: 1
Joined: 02 Sep 2018 Posts: 101
|
Posted: Tue Dec 10, 2019 12:09 pm Post subject: |
|
|
no one knows?
_________________
hi |
|
| Back to top |
|
 |
SEKTION Cheater
Reputation: 0
Joined: 05 Nov 2017 Posts: 39 Location: Behind the keyboard
|
Posted: Wed Dec 11, 2019 11:57 pm Post subject: |
|
|
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 |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Thu Dec 12, 2019 2:19 am Post subject: |
|
|
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 |
|
 |
exohaxor Expert Cheater
Reputation: 1
Joined: 02 Sep 2018 Posts: 101
|
Posted: Thu Dec 12, 2019 11:37 am Post subject: |
|
|
so can we send DirectInput with vanilla CE?
_________________
hi |
|
| Back to top |
|
 |
|