Page 1 of 1

GetAsyncKeyState Question

Posted: Wed Sep 26, 2018 9:44 pm
by QuasiMorto

Code: Select all

pushad
push 02 //Right mouse button
call GetAsyncKeyState
Sorry if this has been asked 1000 times, but Is it possible to change the mouse button to RT xbox controller?

Re: GetAsyncKeyState Question

Posted: Wed Sep 26, 2018 10:35 pm
by TheyCallMeTim13
QuasiMorto wrote:
Wed Sep 26, 2018 9:44 pm

Code: Select all

pushad
push 02 //Right mouse button
call GetAsyncKeyState
Sorry if this has been asked 1000 times, but Is it possible to change the mouse button to RT xbox controller?
You have to use a different function for the xinput, XInputGetState.
https://docs.microsoft.com/en-us/window ... utgetstate

But CE has getXBox360ControllerState, but it's Lua.
https://wiki.cheatengine.org/index.php? ... ollerState

Re: GetAsyncKeyState Question

Posted: Wed Sep 26, 2018 11:37 pm
by QuasiMorto
Ouch.. That's getting complicated by the minute, the GetAsyncKeyState returns an int and the xinputgestate returns different values. I just wanted to switch this code so I dont have to play with the controler in one hand the mouse on the other hahaha

Re: GetAsyncKeyState Question

Posted: Wed Sep 26, 2018 11:44 pm
by TheyCallMeTim13
QuasiMorto wrote:
Wed Sep 26, 2018 11:37 pm
Ouch.. That's getting complicated by the minute, the GetAsyncKeyState returns an int and the xinputgestate returns different values. I just wanted to switch this code so I dont have to play with the controler in one hand the mouse on the other hahaha
Well, you can't set the controller state with CE, but you could use a thread or timer to read the controller state and set the key state.
https://wiki.cheatengine.org/index.php? ... ass:Thread
https://wiki.cheatengine.org/index.php? ... lass:Timer
https://wiki.cheatengine.org/index.php? ... ollerState
https://wiki.cheatengine.org/index.php? ... doKeyPress