Whats wrong with this?

Ask gaming related questions (AHK v1.1 and older)
skaanlj
Posts: 3
Joined: 16 Mar 2018, 17:11

Whats wrong with this?

17 Mar 2018, 07:15

Hello everybody, rookie question coming up.

None of theese scripts for my gamepad work.

I use a gamepad which i controll with my feet due to a handicap and wants it to press the "t" button for talk in PUBG.

I want the Joy4 to press "t" for as long as i push Joy4 down but it only sends "t" one time.
The script for everything else works, i use all the seven other buttons without any problems, 
remaping my joys and POVs to other keys but those are momentarily.

Hopefully you understand my question.


Theese are the ones i have tried:
Joy4:: 
Send t ; Press t
return

and

Joy4::
Send {t down} ; Hold down t
KeyWait Joy4 ; Wait for the user to release the joy4 button
Send {t up} ; Release t
return
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Whats wrong with this?

17 Mar 2018, 08:29

Try

Code: Select all

Joy4::t
(yes that's it! Just one line!)

This is autohotkey's inbuilt feature for remapping keys.
(https://autohotkey.com/docs/misc/Remap.htm)
I am your average ahk newbie. Just.. a tat more cute. ;)
skaanlj
Posts: 3
Joined: 16 Mar 2018, 17:11

Re: Whats wrong with this?

17 Mar 2018, 11:39

With that line i still only get ONE "t" by pressing Joy4 AND holding it.
I want it to make "t":s for as long as i press Joy4, when i want to talk to others in PUBG.


Thanks / A
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Whats wrong with this?

17 Mar 2018, 12:44

skaanlj wrote:With that line i still only get ONE "t" by pressing Joy4 AND holding it.
I want it to make "t":s for as long as i press Joy4, when i want to talk to others in PUBG.


Thanks / A
Okay try this. It should work. I'm not sure why Joy4::t didn't work though.

Code: Select all

Joy4::
Send {t down}
SetTimer, Joy, 0
return

Joy:
if GetKeyState("Joy4", "P") 
return
SetTimer, Joy, Off
return
Last edited by Nwb on 17 Mar 2018, 22:43, edited 1 time in total.
I am your average ahk newbie. Just.. a tat more cute. ;)
skaanlj
Posts: 3
Joined: 16 Mar 2018, 17:11

Re: Whats wrong with this?

17 Mar 2018, 14:09

Weird, dosent work either.... only get 1 stroke, = ONE t

In the controlpanel, gamepadsettings when i pressing down joy4 it shows that its pressed all time i keep it pressed down and stops when i release joy4.

But this POV works:

else if POV between 4501 and 13500 ; 45 to 135 degrees:
KeyToHoldDown = Lshift

Its for running, that keeps Lshift pressed all time until i releases button......

/ A
jedics
Posts: 4
Joined: 17 Mar 2018, 21:08
Contact:

Re: Whats wrong with this?

17 Mar 2018, 21:59

Im also interested in this, I have a foot pedal that works in pubg for leaning left and right but only with the toggle option selected. If I try to use it for press/hold then release to stand straight it doesn't work at all anymore.

would love a solution to this :)
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Whats wrong with this?

17 Mar 2018, 22:44

skaanlj wrote:Weird, dosent work either.... only get 1 stroke, = ONE t

In the controlpanel, gamepadsettings when i pressing down joy4 it shows that its pressed all time i keep it pressed down and stops when i release joy4.

But this POV works:

else if POV between 4501 and 13500 ; 45 to 135 degrees:
KeyToHoldDown = Lshift

Its for running, that keeps Lshift pressed all time until i releases button......

/ A
jedics wrote:Im also interested in this, I have a foot pedal that works in pubg for leaning left and right but only with the toggle option selected. If I try to use it for press/hold then release to stand straight it doesn't work at all anymore.

would love a solution to this :)

Try the script now? I edited it.
I am your average ahk newbie. Just.. a tat more cute. ;)
jedics
Posts: 4
Joined: 17 Mar 2018, 21:08
Contact:

Re: Whats wrong with this?

17 Mar 2018, 22:56

I dont know what Im doing and obviously my use is a bit different, I'm using [ to lean left, and ] to lean right so I changed what you wrote to this but it didn't work

Joy4::
Send {] down}
SetTimer, Joy, 0
return

Joy:
if GetKeyState("Joy4", "]")
return
SetTimer, Joy, Off
return
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Whats wrong with this?

17 Mar 2018, 23:10

jedics wrote:I dont know what Im doing and obviously my use is a bit different, I'm using [ to lean left, and ] to lean right so I changed what you wrote to this but it didn't work

Joy4::
Send {] down}
SetTimer, Joy, 0
return

Joy:
if GetKeyState("Joy4", "]")
return
SetTimer, Joy, Off
return
Okay try this.

Code: Select all

Joy4::
Send, {] down}
SetTimer, Joy, 0
return

Joy:
if GetKeyState("Joy4", "P") 
return
Send, {] up}
SetTimer, Joy, Off
return
I am your average ahk newbie. Just.. a tat more cute. ;)
jedics
Posts: 4
Joined: 17 Mar 2018, 21:08
Contact:

Re: Whats wrong with this?

17 Mar 2018, 23:26

still the same the [ and ] keys work on my footswitch in toggle mode only but not in 'hold' mode yet it works on my keyboard fine.
User avatar
Nwb
Posts: 444
Joined: 29 Nov 2016, 08:56

Re: Whats wrong with this?

17 Mar 2018, 23:28

I'm not sure about this. :wtf:
I am your average ahk newbie. Just.. a tat more cute. ;)
jedics
Posts: 4
Joined: 17 Mar 2018, 21:08
Contact:

Re: Whats wrong with this?

18 Mar 2018, 03:22

yeh, seems like a pretty common thing to want to do but there is very little I could find online about doing it.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: jameswrightesq and 140 guests