RETROBAT Official Board
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Help Autohotkey

4 posters

Go down

Help Autohotkey Empty Help Autohotkey

Post by LUXBUIO 23/06/20, 06:13 pm

Help, is possible to run "Autohotkey.exe" after run emulator(in es_settings.cfg) . I need for exit with controller some emulator (like....cxbx-reloaded). Thanks.
LUXBUIO
LUXBUIO

Messages : 20
Date d'inscription : 2020-05-24

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by Kayl 23/06/20, 08:44 pm

Hello,

If you want to do this you need to create your own scripts. EmulationStation support some keywords as folders to launch scripts. For example, create a folder "game-start" in scripts folder of ES and place scripts (such *.bat files) inside if you want your script to be launched when a game start. You can also create a folder "game-end" to launch scripts when you exit a game.



Help Autohotkey Admin4
Kayl
Kayl
Admin

Messages : 301
Date d'inscription : 2019-06-03
Localisation : Galaxie de l'Ouest

https://www.retrobat.ovh

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by Gigi1985 23/06/20, 09:08 pm

Good evening to all.

Or you can start the script when you start emulation station. If you are on windows, you can run a script that, when you press a certain joystick button will send escape (or whatever key closes it) to the running emulator. If you're not running multiple emulators at the same time you can have the script sending multiple key to multiple emulators, only the one that runs at the moment will pick it up. I have it set up like this. I even have a "panic button", in case some emulator hangs (on windows it happens quite often), that way I can control everything with the joystick. I prefer autohotkey exes instead of a bat, that way I can have it running in the background.
Gigi1985
Gigi1985

Messages : 6
Date d'inscription : 2020-05-20

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by LUXBUIO 24/06/20, 11:09 am

Thanks, let me explain better.
I have "Cemu" and "cxbx-reloaded" that not exit with "controller combo".
I have create 2 AutoHotkey.ahk, 1 for Cemu, and, 1 for "cxbx-reloaded", i need that before start emulators - start the appropriate AutoHotkey.ahk.
Becouse the AutoHotkey.ahk that i have created when i use "controller combo", close the emulator and AutoHotkey.exe.
The code of .ahk is follow:

---------------------------------------------
~Joy8::

if (GetKeyState("Joy7","P")=1)
{
   Process, Close, Cemu.exe
}

#If WinActive("AutoHotkey.exe")
Esc::
Winclose
ExitApp
---------------------------------------------
for cxbx-reloaded  "Process, Close, cxbx.exe".

How can I solve it? Thank you.
LUXBUIO
LUXBUIO

Messages : 20
Date d'inscription : 2020-05-24

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by Lorenzolamas 24/06/20, 07:25 pm

please, choose an avatar...
Lorenzolamas
Lorenzolamas
Admin

Messages : 2544
Date d'inscription : 2019-07-28

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by LUXBUIO 24/06/20, 07:31 pm

ok i made Very Happy
LUXBUIO
LUXBUIO

Messages : 20
Date d'inscription : 2020-05-24

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by Gigi1985 24/06/20, 11:07 pm

Why two? You can have them all in one.
I have my batch like this (as far as i can remember):

#singleinstance, force
#notrayicon
Joy10:: ;thats the start button that executes the command
if GetKeYState ("Joy9") ;you have to hold the select button first (like in retroarch, when you hold select and press start to exit)
{
Sleep 1000 ;so that it doesnt execute instantly
Send, , {esc}, pcsx2.exe ;sends esc key to pscx2 emulator
Send, , {esc}, dolphin.exe ;sends esc key to dolphin.exe
Send, , {whateverkey}, whatever_emulator.exe
}
return

Joy5:: ; L1 ; some sort of panic button, presing L1+L2+L3+R1+R2+R3 at the same time will force close all listed emulators
Joy6:: ; R1
Joy7:: ; L2
Joy8:: ; R2
Joy11:: ;L3
Joy12:: ;R3
if getkeystate ("Joy5")
if getkeystate ("Joy6")
if getkeystate ("Joy7")
if getkeystate ("Joy8")
if getkeystate ("Joy11")
if getkeystate ("Joy12")
{
Sleep 1000
process, close, pcsx2.exe
process, close, retroarch.exe
process, close, dolphin.exe
process, close, wathever_emulator.exe
}
return


You can use "ifwinexists", "ifwinactive", that way you can send keys to specific emulator!
Gigi1985
Gigi1985

Messages : 6
Date d'inscription : 2020-05-20

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by LUXBUIO 25/06/20, 09:53 am

Thanks, i don't think.....one for all, that start with Retrobat and close with Retrobat.
LUXBUIO
LUXBUIO

Messages : 20
Date d'inscription : 2020-05-24

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by LUXBUIO 25/06/20, 10:13 am

Works!!! Thanks!
LUXBUIO
LUXBUIO

Messages : 20
Date d'inscription : 2020-05-24

Back to top Go down

Help Autohotkey Empty Re: Help Autohotkey

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum