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 TimFun13
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.
[Link]

But CE has getXBox360ControllerState, but it's Lua.
[Link]

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 TimFun13
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.
[Link]
[Link]
[Link]
[Link]