Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Joypad to Keystroke (Guitar Hero III for PC)


  • Please log in to reply
15 replies to this topic
Aircraft800
  • Guests
  • Last active:
  • Joined: --
First a little background:

I have Guitar Hero 3 for PC and want to be able to use my Guitar Hero II guitar using the PS2 to PS3 adapter and AHK. GH3 will NOT recognize a PS2 guitar (with USB adapter) so I need to be able to remap the GH2 keys.

I have the Guitar installed and Windows Vista recognizes it as a 5 axis 19 button joystick, I want to be able to write the script and share it to anyone else who needs it. I can see all of the keys in the control panel.

Keys on Guitar-------------------------------------- Keypad
Green---------Joy10---------------------------------v
Red-----------Joy14---------------------------------c
Yellow--------Joy13----------------------------------x
Blue----------Joy 15----------------------------------z
Orange-------Joy16---------------------------------L shift
Head Bang---Joy9-------------------------------Button 2 (Mouse Wheel Click)
Whammy-----Y-axis (127 rst – 0 prsed)--------Mouse x-axis
Select---------Joy1---------------------------------(I don't know)
Start----------Joy4---------------------------------Enter
Pick down----Joy7--------------------------------Button 0 (Left Mouse)
Pick up-------Joy5--------------------------------Button 1 (Right mouse)


Here is Script I tried for the Green key:

Joy10::
Send {v down}
KeyWait Joy10
Send {v up}
Return

PROBLEM:

When I press and hold the green key, it is only sending one “V” click; I need it to stay down (latched) until I release it. The script should work just like holding down the “v” key on the keyboard, but it is only momentary pressing it.

If I can get past this small hurdle, I should be able to get the rest.

Thanks!!!

(New here, take it easy, read the FAQ and Tutorial)

Blinks
  • Guests
  • Last active:
  • Joined: --
You could try something like this. Pressing G will send hold V down, once you release G the message box should pop up to prove the code is functioning and the v key should release.

g::
Send {v down}
Loop 
	{
	 GetKeyState, state, g, P
	 IfNotEqual, state, D
		{
		 MsgBox, Key released
		 Break
		}
	 }
Send {v up}
Return 

or is it that you need to repeatedly send the same key over and over?

Aircraft800
  • Members
  • 7 posts
  • Last active: Jul 15 2008 04:37 PM
  • Joined: 23 Nov 2007
I think I was wrong, this script seems to work in the game:

Joy10::
Send {v down}
KeyWait Joy10
Send {v up}
Return

It just didn't work in notepad, the hold down repeat letter must be a function of the keyboard, because when I run the script, it only types one "v" stroke, however, in the game, it IS holding down the keystroke.

I'll update here if I get all of the script done.

Thanks for the help..

Aircraft800
  • Members
  • 7 posts
  • Last active: Jul 15 2008 04:37 PM
  • Joined: 23 Nov 2007
That Code works for the Guitar, but it doesn't work flawlessly.

If I press 2 keys down simultaneously, and release one, both keys are still down :( They only release when I let go of BOTH, not real good when playing chords....

Back to the drawing board.

Any clues if I can fix this ???

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
try
Joy10::
Send {v down} 
Return

Joy10 up::
Send {v up} 
Return


Aircraft800
  • Members
  • 7 posts
  • Last active: Jul 15 2008 04:37 PM
  • Joined: 23 Nov 2007
Darn, I was so excited, but it didn't work :(

None of the joy presses (frets on guitar) did anything.

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
now it gets fun

settimer release, 10

Joy10::
Send, {v down}
vpressed := true
return

Joy14::
Send, {c down}
cpressed := true
return

release:
if (vpressed and not GetKeyState("Joy10"))
{
  send, {v up}
  vpressed := false
}
if (cpressed and not GetKeyState("Joy14"))
{
  send, {c up}
  cpressed := false
}
;...etc...
return


eldamar
  • Members
  • 1 posts
  • Last active: Nov 28 2007 11:07 AM
  • Joined: 28 Nov 2007
The last script worked perfectly for the frets ^^ but im still new to all this and i need some help with the rest.

did you make a script for the pick down and up.. my adapter points pickup to 13 och pickdown to 15. can annyone help me with the script for these buttons?

This is my script so far...
settimer release, 10 

Joy6:: 
Send, {v down} 
vpressed := true 
return

Joy2:: 
Send, {c down} 
cpressed := true 
return

Joy1:: 
Send, {x down} 
xpressed := true 
return

Joy3:: 
Send, {z down} 
zpressed := true 
return

Joy4:: 
Send, {Shift down} 
shiftpressed := true 
return

release: 
if (vpressed and not GetKeyState("Joy6")) 
{ 
  send, {v up} 
  vpressed := false 
} 
if (cpressed and not GetKeyState("Joy2")) 
{ 
  send, {c up} 
  cpressed := false 
}
if (xpressed and not GetKeyState("Joy1")) 
{ 
  send, {x up} 
  xpressed := false 
}
if (zpressed and not GetKeyState("Joy3")) 
{ 
  send, {z up} 
  zpressed := false 
} 
if (shiftpressed and not GetKeyState("Joy4")) 
{ 
  send, {Shift up} 
  shiftpressed := false 
} 
return



Aircraft800
  • Members
  • 7 posts
  • Last active: Jul 15 2008 04:37 PM
  • Joined: 23 Nov 2007
Who Hoo engunneer!!

That worked GREAT!!!! No Overlap now!!


Joy15::
Send {/ down}
KeyWait Joy15 
Send {/ up}
return

Joy13::
Send {Rshift down}
KeyWait Joy13 
Send {Rshift up}
return

eldamar,

Try the simple code, it seems to work fine since there is no way to get the pick to overlap since it's up or down anyway (I'm not sure which keys yours is set to, you may have to change that)

eldamar,

Have you figured out the whammy?
Keys on Guitar-------------------------------------- Keypad
Whammy-----Y-axis (127 rst – 0 prsed)--------Mouse x-axis

I didn't get a chance to write this one yet, it sounded simple at first...

NLI-Conquer
  • Guests
  • Last active:
  • Joined: --
GetKeyState, joyY, JoyY
Use the above code to store joy Y's (whammy bar?)

Aircraft800
  • Members
  • 7 posts
  • Last active: Jul 15 2008 04:37 PM
  • Joined: 23 Nov 2007

GetKeyState, joyY, JoyY
Use the above code to store joy Y's (whammy bar?)


Sorry Man, I didn't quite understand. I am trying to learn GetKeyState to make the script, it should be easy, but there is a learning curve I'm at the bottom :(

Using GetKeyState I can see the Whammy Y=50 unpressed and Y=0 fully pressed. I just need it to move the the mouse along the X=Axis. I'll study up on it and update this post....

EDIT: I found some info here:
<!-- m -->http://www.autohotke... ... kMouse.htm<!-- m -->
I Can figure this out, just need to flip an axis and eliminate the unwanted, I'll update...

justin
  • Guests
  • Last active:
  • Joined: --
I'm trying to use this script with a Rock Band guitar controller, and I'm combining it with a POV script to try to make it work. The problem I'm having is that whenever I use the fret keys, they keys aren't being released when I take my finger off the button. The only way that I can reset them to a released state is to press the actual key on the keyboard.

Here is the full script I am using:

#Persistent  ; Keep this script running until the user explicitly exits it.
Joy1::
Send, {z down}
zpressed := true
return

Joy2::
Send, {x down}
xpressed := true
return

Joy4::
Send, {c down}
cpressed := true
return

Joy3::
Send, {v down}
vpressed := true
return

Joy5::
Send, {Shift down}
shiftpressed := true
return

SetTimer, WatchPOV, 5
return

WatchPOV:
GetKeyState, POV, JoyPOV  ; Get position of the POV control.
KeyToHoldDownPrev = %KeyToHoldDown%  ; Prev now holds the key that was down before (if any).

; Some joysticks might have a smooth/continous POV rather than one in fixed increments.
; To support them all, use a range:
if POV = -1
    KeyToHoldDown =
else if POV = 18000                 ; held down
    KeyToHoldDown = o   ;strum down
else if POV = 0      ; held up
    KeyToHoldDown = l   ;strum up

if KeyToHoldDown = %KeyToHoldDownPrev%  ; The correct key is already down (or no key is needed).
    return  ; Do nothing.

; Otherwise, release the previous key and press down the new key:
SetKeyDelay -1  ; Avoid delays between keystrokes.
if KeyToHoldDownPrev   ; There is a previous key to release.
    Send, {%KeyToHoldDownPrev% up}  ; Release it.
if KeyToHoldDown   ; There is a key to press down.
    Send, {%KeyToHoldDown% down}  ; Press it down.

if (vpressed and not GetKeyState("Joy3"))
{
  Send, {v up}
  vpressed := false
}
if (cpressed and not GetKeyState("Joy4"))
{
  Send, {c up}
  cpressed := false
}
if (xpressed and not GetKeyState("Joy2"))
{
  Send, {x up}
  xpressed := false
}
if (zpressed and not GetKeyState("Joy1"))
{
  Send, {z up}
  zpressed := false
}
if (shiftpressed and not GetKeyState("Joy4"))
{
  Send, {Shift up}
  shiftpressed := false
}
return

Any Ideas?

justin
  • Guests
  • Last active:
  • Joined: --
I found a solution. A program called GlovePIE works very well for this, and with only 6 small lines of code. Seems to be much more efficient than autohotkey.

Aircraft800
  • Members
  • 7 posts
  • Last active: Jul 15 2008 04:37 PM
  • Joined: 23 Nov 2007

I found a solution. A program called GlovePIE works very well for this, and with only 6 small lines of code. Seems to be much more efficient than autohotkey.


I took a look at this one, the only thing that's stopping me is the Whammy bar to mouse emulation. I can't figure out the needed script...

trixrabbit13
  • Guests
  • Last active:
  • Joined: --
I did my own fix for this and it takes about 5 min. I just un-soldered the 3 wires to the whammy bar, then take 2 pieces of wire from the select button leads and solder them to the first 2 pins of the whammy bar, and then the whammy bar becomes controller button 9 since its not ever used in the game anyway. so my select button and the whammy bar is button 9, then in joy2key you simply make button 9 the R-alt key and you get a working whammy bar simply and easy. If you ever want to change it back you can just as easy. You dont damage anything simply reroute the button to the whammy. I can post pics if anyone is interested. Peace outs.

( i know this posting is OLD AS THE HILLS, but i figured if i was looking for a fix im sure others still are as well )