Author Topic: Controls question  (Read 2714 times)

Controls question
« on: March 22, 2013, 09:45:29 PM »
Hi, new member here.
I've got a problem with my hand, so holding down the fire/slow keys is getting to be a serious problem over long periods of play. Does anyone here know of a method to toggle your fire/slow keys so that activating them only takes one tap and deactivating works the same way?
Wasn't sure where to ask this, and I came to this forum pretty exclusively to find an answer. I appreciate any help I can get with this.
« Last Edit: March 22, 2013, 09:53:36 PM by correcttrain »

Re: Controls question
« Reply #1 on: March 22, 2013, 10:28:55 PM »
It is possible make an AutoHotkey script to do that, but I don't really remember how to. Maybe Goldom could help.

Zil

Re: Controls question
« Reply #2 on: March 22, 2013, 10:32:05 PM »
You can apparently use AutoHotkey to achieve something like that, such as what was done for GFW in this thread. - http://www.shrinemaiden.org/forum/index.php/topic,14351.0.html

I don't know anything about using that program myself, but maybe you could work it out, or just ask somebody who knows more (like Goldom maybe). There is a general tech/programming/whatever thread on this forum but I don't know if you can access that area until you have ten posts or so.

edit: Cut by Wriggle, but yeah. I think Goldom's your man, if you can contact him.

Also, if possible, try to avoid using this for the focus button, as it could be extremely cumbersome in a few situations. Using it to shoot should be mostly fine though.
« Last Edit: March 22, 2013, 10:39:56 PM by Zil »

Goldom

  • Whee
Re: Controls question
« Reply #3 on: March 23, 2013, 01:25:10 AM »
The things I'm known for =D

Well, I put something together that should work for you. Download the attached ahk file or paste the below code into a text file saved with the .ahk extension. Either way, run the file with AutoHotkey installed. It'll sit in your taskbar as a green H icon. To use it, use the 1, 2 and 3 keys to toggle the hold effect on and off for Shift, Z and C respectively. (C, obviously, only for GFW). The hold effect starts OFF, so don't turn it on until you're in the game, or using the menus will be awkward. Once on, tap the game keys once to lock them on/off. You can edit the script where the numbers 1 2 or 3 are, if you want to use keys other than 1 2 3 to toggle.

I'll also attach a compiled exe version if you want it portable or don't wanna install AutoHotkey. Of course, with a compiled version you can't edit anything, and your antivirus will probably go "We don't recognize this program!!!" because I just created it. (Even my own did, so). But if you allow it it'll work just the same.

Code: [Select]
#NoEnv ;Touhou key toggles by Goldom
#Warn
#Warn UseUnsetGlobal, off
GroupAdd Touhou, ahk_class BASE
GroupAdd Touhou, ahk_class NP2-MainWindow
GroupAdd Touhou, ahk_class zwxwnd
GroupAdd Touhou, ahk_class T98-Next
Hotkey $LShift, shiftswitch, off
Hotkey $z, zswitch, off
Hotkey $c, cswitch, off
#IfWinActive ahk_group Touhou
1::
Hotkey $LShift, toggle
SendInput {LShift up}
shiftvar := 0
Return
2::
Hotkey $z, toggle
SendInput {z up}
zvar := 0
Return
3::
Hotkey $c, toggle
SendInput {c up}
cvar := 0
Return

shiftswitch:
if shiftvar
{
SendInput {LShift up}
shiftvar--
}
else
{
SendInput {LShift down}
shiftvar++
}
Return
zswitch:
if zvar
{
SendInput {z up}
zvar--
}
else
{
SendInput {z down}
zvar++
}
Return
cswitch:
if cvar
{
SendInput {c up}
cvar--
}
else
{
SendInput {c down}
cvar++
}
Return

Side note: I figured out why I was having so much trouble with my other script while working on this one. For some reason, AHK can't see keys you press in TD, even though it's set to watch all windows. All other Touhous work just fine. But for TD you have to specifically tell it to watch TD, or it misses it. No idea why. But since all Windows Touhou games use ahk_class BASE, that's no big deal once I figured it out. The above code also includes the ahk_class IDs for all three PC-98 emulators as well.
« Last Edit: March 23, 2013, 01:32:47 AM by Goldom »

Re: Controls question
« Reply #4 on: March 23, 2013, 03:31:40 AM »
Thanks, all of you. I really appreciate this help. I've just tested the ahk script and it does everything I need it to. Including the control for GFW was icing on the cake for me, since it's one of my favourites (even if I can't beat it yet). The info on TD is also good stuff. This will make playing so much easier for me.
I'm really amazed by the response I got from here. Can't express how happy this makes me. Considering what AutoHotkey is apparently capable of, I'll work on learning how to write my own scripts too. The urge to write thanks for all this more is strong.