On/off modifier xbox 360 rt/lt

Ask gaming related questions
frogger
Posts: 4
Joined: 16 Apr 2018, 16:31

On/off modifier xbox 360 rt/lt

17 Apr 2018, 14:17

So there is this script that make rt and lt a modifier :

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



using this xinput.ahk :

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus




And I'm wondering if there would be a way to switch those modifier to be on a on/off instead of holding them? Maybe using keytoholddown/keytoholddownprev?
Last edited by frogger on 18 Apr 2018, 15:15, edited 1 time in total.
User avatar
evilC
Posts: 4087
Joined: 27 Feb 2014, 12:30

Re: On/off modifier xbox 360 rt/lt

18 Apr 2018, 05:51

You know, right, that AVAR is common to ALL buttons?
You hold A, it sets AVAR to b and sends b down. Without releasing A, you hit B, and it sets AVAR to f
When you release A, AVAR is no longer set to b, so it sends f up, not b up.

The script needs a total redesign IMHO.
frogger
Posts: 4
Joined: 16 Apr 2018, 16:31

Re: On/off modifier xbox 360 rt/lt

18 Apr 2018, 15:11

it's a non issue for it's purpose but i've changed it to 1var to 10var to make it "cleaner". I'm not a coder and it's the first time I touch autohotkey.

Do you think that it's possible to make rt,lt and rt+lt a trigger modifier instead of a holding one?

edit : doesnt this prevent the issue you are talking about

Code: [Select all] [Download] GeSHi © Codebox Plus

WaitForButtonUpA:
if not GetKeyState("Joy1")
User avatar
evilC
Posts: 4087
Joined: 27 Feb 2014, 12:30

Re: On/off modifier xbox 360 rt/lt

19 Apr 2018, 07:48

Here you go - this technique should save you a TON of coding.

It shows you how to use one function to handle watching for release of all buttons and sending the appropriate key up event.

I used my own poll loop (Regular GetKeyState instead of XInput like you want), but otherwise the rest of the code should be good.
I also commented out the actual sending of keys and replaced them with Tooltips, to make it easier for me to debug.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

frogger
Posts: 4
Joined: 16 Apr 2018, 16:31

Re: On/off modifier xbox 360 rt/lt

20 Apr 2018, 21:00

Thanks. It's for a old game and it's very capricious about key, as an example it sometime require capital letter but will not recognize capital letter, it need shift down d down d up shift up to work with the D shortcut, any other syntax doesnt work, tested them all, atleast all that i found.
I'm not sure how to do that using your code.

And im assuming you tested it with the left joystick(x/y) instead of the rt/lt(z)?

As for my initial issue i'm thinking about binding a simple profil switching instead.

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 4 guests