d8thstar Posted May 4, 2021 Share Posted May 4, 2021 hi all, i have tried both vice and ccs64. i am moving away from using joy2key and teh c64 is the last emu giving me problems. i have joysticks set up for movement on my cabinet but i am using a keyboard encoder to send keystrokes for buttons. c64 emus allow me to either use a joystick or keys, but i cant seem to use both. i'd like to set up joystick directions and use key N for the fire button. anyone have any thoughts? maybe an AHK script to send joystick button with the press of N? Quote Link to comment Share on other sites More sharing options...
d8thstar Posted May 4, 2021 Author Share Posted May 4, 2021 if anyone is interested, i found this script and it works like a charm! #Persistent ; Keep this script running until the user explicitly exits it. SetTimer, WatchAxis, 5 return WatchAxis: JoyX := GetKeyState("JoyX") ; Get position of X axis. JoyY := GetKeyState("JoyY") ; Get position of Y axis. KeyToHoldDownPrev := KeyToHoldDown ; Prev now holds the key that was down before (if any). if (JoyX > 70) KeyToHoldDown := "Right" else if (JoyX < 30) KeyToHoldDown := "Left" else if (JoyY > 70) KeyToHoldDown := "Down" else if (JoyY < 30) KeyToHoldDown := "Up" else KeyToHoldDown := "" 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. return $Esc:: { Process, Close, {{{StartupEXE}}} } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.