Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider becoming a contibuting member by either clicking this text or the Patreon link on the right.

Patreon

If neither of those of work for you, you can donate any amount by clicking here.

Recommended Posts

Posted

I'm getting this cab set up for GGPO, and I have a script that I launch with it to give me control of the mouse with the joystick, but I need a way to trigger an alt+tab press with buttons 8, 2, 3, and 6 so that I can just press those to enter and exit fullscreen. I'm also wondering how I can make sure this accompanying script shuts down after I'm done with GGPO. What's the easiest way to do that? Make another script that kills it and set to launch after? How do I kill another script in AHK? Thanks!

Posted

I don't know that this is the solution to your problem, but you can only kill a script if it's compiled or if you know the process ID. If you try to kill an AHK script with another AHK script and you don't know the PID, it might kill the wrong one (the script you are trying to use to kill the other script). Anyway, if you compile the first one, then it will show up in the task manager as whatever you compiled it as. By default, all AHK scripts just show up as "AutoHotKey.exe".

Btw, don't you need Alt-Enter for switching to full screen? AHK can do that easily if it's for a keyboard. If this is for a joystick, then it's a bit more complicated.

Posted
  dmauro said:
It's for a joystick. Specifically what code do I use in AHK to target and kill another exe script?

Process, Close. Myprocessname.exe

Compile your script to an EXE then use this. process name is the EXE name.

Posted

That doesn't seem to be working for me:

#SingleInstance Force
Process, Close, ggpo.exe;
Process, Close, ggpoair.exe;
Process, Close, ggpofba.exe;
Process, Close, JoystickMouse.exe;

Doesn't seem to do anything to those processes. (edit: actually, the script isn't even running in the toolbar, even when I take the ExitApp line out. It doesn't sick around, which makes me think it might not be running at all, but I'm not getting an error.

On the plus side, I figured out how to get alt +enter to work:

1Joy9::
GetKeyState, State, 2Joy9
If State = D
{
Send !{Enter};
}
return

Goes to full screen by hitting start on player 1 and player 2 controls at the same time.

Posted

Your button remapping script is pretty rudimentary, but it should work. It will just have to run more than once if you press button 1Joy9 before you press 2Joy9.

The process closing script won't stay resident if that's what you were expecting. It will run and close those processes if they exist. If not, the script will happily move on to the next statement.

Posted
  bkenobi said:
Your button remapping script is pretty rudimentary, but it should work. It will just have to run more than once if you press button 1Joy9 before you press 2Joy9.

How would I make it cleaner so that it's both at the same time. The & only works for keyboard keys unfortunately.

  Quote
The process closing script won't stay resident if that's what you were expecting. It will run and close those processes if they exist. If not, the script will happily move on to the next statement.

It's not even doing that. I kind of was expecting that it would stay resident without the ExitApp function, but I don't want it resident. I want it to run once and kill everything, and then close itself. It's just not killing them at all. (and those are the exe names as they appear in the task manager)

I also tried the WinClose command and that didn't work either.

Posted
  dmauro said:
That doesn't seem to be working for me:

#SingleInstance Force
Process, Close, ggpo.exe;
Process, Close, ggpoair.exe;
Process, Close, ggpofba.exe;
Process, Close, JoystickMouse.exe;

Doesn't seem to do anything to those processes. (edit: actually, the script isn't even running in the toolbar, even when I take the ExitApp line out. It doesn't sick around, which makes me think it might not be running at all, but I'm not getting an error.

On the plus side, I figured out how to get alt +enter to work:

1Joy9::
GetKeyState, State, 2Joy9
If State = D
{
Send !{Enter};
}
return

Goes to full screen by hitting start on player 1 and player 2 controls at the same time.

Is that your whole code.

#persistent should keep a script running.

Can you post your whole code.

In script 1 you can say

ESC::

ExitApp

in script 2 you can say

Process, waitclose, script1.exe

exitapp

perhaps..

Heck you might be able to put it all in one script.

IDK

Posted

Well it'd be just as easy to have a separate "run on exit" script that just kills everything. The problem is that the script isn't killing anything. The WinClose and Process, close commands aren't actually closing the programs.

for the record, I don't want the kill script sticking around. It runs, kills everything, goes away. The joystickmouse/alt+enter script sticks around just fine, so that's not a problem.

Posted
  dmauro said:
Well it'd be just as easy to have a separate "run on exit" script that just kills everything. The problem is that the script isn't killing anything. The WinClose and Process, close commands aren't actually closing the programs.

for the record, I don't want the kill script sticking around. It runs, kills everything, goes away. The joystickmouse/alt+enter script sticks around just fine, so that's not a problem.

Post your whole script.

Both of and I may get some time to take a look at them. It should not be too hard I have had good luck doing these things before.

Posted
  Brian Hoffman said:
Post your whole script.

That's the entire kill script. The JoystickMouse one is sort of irrelevant because it's working properly.

Posted

Try adding "DetectHiddenWindows, On" to the beginning of your script and "DetectHiddenWindows, Off" to the end. If there's no window associated with the process, AHK won't work sometimes...

Guest
This topic is now closed to further replies.
×
×
  • Create New...