Toggle right trigger on xbox one controller
Toggle right trigger on xbox one controller
Hello.
I want RT on my xbox one controller to be on a toggle. So I tap it once and it remains held down until I tap it again. Can anyone please help me with the code?
Thank you.
I want RT on my xbox one controller to be on a toggle. So I tap it once and it remains held down until I tap it again. Can anyone please help me with the code?
Thank you.
Re: Toggle right trigger on xbox one controller
Bump. Anyone please?
Re: Toggle right trigger on xbox one controller
I do not have Xbox. Below is a general format that works on a keyboard. You may be able to adapt it.
You might want to look at the other forum posts about Xbox, too.
Code: Select all
$x::Send % GetKeyState("x") ? "{x up}" : "{x down}"
Re: Toggle right trigger on xbox one controller
Thank you. But I can't find the correct designation for the xbox controller buttons. I tried RT, 1joy (and other numbers), joy1, B1.mikeyww wrote: ↑28 Nov 2022, 16:07I do not have Xbox. Below is a general format that works on a keyboard. You may be able to adapt it.
You might want to look at the other forum posts about Xbox, too.Code: Select all
$x::Send % GetKeyState("x") ? "{x up}" : "{x down}"
Re: Toggle right trigger on xbox one controller
Hi,
I can't help much with that part, but would have a look at XInput by lexikos, in case it works or leads in a useful direction.
I can't help much with that part, but would have a look at XInput by lexikos, in case it works or leads in a useful direction.
Re: Toggle right trigger on xbox one controller
The triggers are analog devices that cannot be set to act as hotkeys because they are not binary. You sample their state using GetKeyState(), where the key name is JoyZ. The nominal value when both are in released state is 50. The left trigger adds 1-50 to that value depending on how far it is pulled. Similarly, the right trigger subtracts 1-50. AHK doesn't allow for distinguishing between the two when both are pulled simultaneously. For that, you can use lexikos' XInput as mikeyww suggested.
Re: Toggle right trigger on xbox one controller
I looked through lexikos' code and I have no idea what's going on. I haven't figured out how to make what I want work.boiler wrote: ↑28 Nov 2022, 20:33The triggers are analog devices that cannot be set to act as hotkeys because they are not binary. You sample their state using GetKeyState(), where the key name is JoyZ. The nominal value when both are in released state is 50. The left trigger adds 1-50 to that value depending on how far it is pulled. Similarly, the right trigger subtracts 1-50. AHK doesn't allow for distinguishing between the two when both are pulled simultaneously. For that, you can use lexikos' XInput as mikeyww suggested.
Re: Toggle right trigger on xbox one controller
I don’t know anything about his code, but it’s not necessary if you just want to act on the right trigger as long as the left and right triggers won’t be pulled simultaneously. You would just use native AHK as I described using GetKeyState().