GetAsyncKeyState Question

QuasiMorto

QuasiMorto

Cheater
Joined
Jul 25, 2017
Messages
31
Code:
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?
 
TheyCallMeTim13

TheyCallMeTim13

Enchanter
Staff member
Administrator
Fearless Donors
Talents
Joined
Mar 3, 2017
Messages
1,794
QuasiMorto said:
Code:
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/windows/desktop/api/xinput/nf-xinput-xinputgetstate

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

QuasiMorto

Cheater
Joined
Jul 25, 2017
Messages
31
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
 
TheyCallMeTim13

TheyCallMeTim13

Enchanter
Staff member
Administrator
Fearless Donors
Talents
Joined
Mar 3, 2017
Messages
1,794
QuasiMorto said:
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?title=Lua:Class:Thread
https://wiki.cheatengine.org/index.php?title=Lua:Class:Timer
https://wiki.cheatengine.org/index.php?title=Lua:getXBox360ControllerState
https://wiki.cheatengine.org/index.php?title=Lua:doKeyPress
 
Top