Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


Lordmonkus

Recommended Posts

You may have to 'pay' to get it to work.  Try putting a "$" in front of vk07 (just the 1st one)

$vk07::
{
  KeyWait, vk07, T2       ;wait to see if the Guide buttom is held for 2 ("T2") seconds
  If (ErrorLevel)         ;if held for 2 seconds, then...
  {
   ...........

I've only ever tested this ("long-press") with 'regular' buttons (i.e. 1Joy1).  Hopefully the money helps. ;) 

Link to comment
Share on other sites

1 hour ago, jacks897 said:

still not working

So I actually connected my controller and did some testing with the Guide button and yup! couldn't get it work "directly" with a long-press.

"Indirectly" (maybe not the correct use of the word) I was able to get it to 'work' using a long-press button combo.  

This example you press and hold the Guide button (vk07) and then tap the "B" (1Joy2) button, while still holding the Guide button for 2 [more] seconds.

1Joy2::
{
  KeyWait, vk07, T2
  If (ErrorLevel)
  {
   ...........

If you swap the 2 buttons in the script, it doesn't work.  In that case, it seems like the Guide button is acting like a momentary switch [which you can't hold down].

Of course, you can use any button combo for the long-press effect, or any single button for a long-press as long as it's not the Guide button. :D

 

If you decide to use this 'example' remember to set the "B" button at the bottom of the script to be "B" [if not long-pressed].

...........
else                  ;if held for less that 2 seconds
  {
     Joy2::Joy2       ;then the "B" is just "B"
  }
}

 

  • Thanks 1
Link to comment
Share on other sites

32 minutes ago, jacks897 said:

Hey, would it be possible to make it so that pressing the guide button 2 times quickly would trigger the script?

 

I figured this one out myself, here it is if it helps anyone else

vk07::

If (A_ThisHotkey == A_PriorHotkey && A_TimeSincePriorHotkey < 400)
{
if !WinExist("ahk_exe yBigBox.exe")
    Run C:\Users\Jack\LaunchBox\Core\BigBox.exe   
else
    WinActivate, ahk_exe BigBox.exe

Run %A_ScriptDir%\nircmd.exe setdefaultsounddevice "32W_LCD_TV" ;

send {esc}

WinClose, ahk_exe retroarch.exe

WinClose, ahk_exe Dolphin.exe

WinClose, ahk_exe pcsx2.exe

WinClose, ahk_exe pcsx2.exe

WinClose, ahk_exe PPSSPP

WinClose, ahk_exe kodi.exe

WinClose, ahk_exe citra-qt.exe

WinClose, ahk_exe Cemu.exe

Send {y}

}

 

 

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, jacks897 said:

Does anyone know how to shrink a PCem hard drive .img file?

You can't. But you shouldn't be using .img hdds anyway. PCem (v17) lets you create variable size / dynamically-expanding vhds. You specify a size that you want to be seen in the VM - 16GB, 32GB, whatever you want - but the actual size that it occupies is only however much space is used by the files on the drive, and it dynamically expands as you add more, up to whatever the maximum size was that your specified on creation.

Link to comment
Share on other sites

Thanks, that sounds like a much better way of using the hdd's. Is there a way to convert an img hard drive to a vhd?

i downloaded a copy of a Windows 98 image on Archive.org that was already configured for pcem, that's why I have an img file :)
 

Link to comment
Share on other sites

I don't believe so, no.

You could always "reverse engineer" one of my game packages that use PCem, just uninstalling the game in the 98 environment and then putting whatever you wanted on. The newer ones are setup with variable vhds. The older ones are imgs, from before those were available.

https://www.zombs-lair.com/

It's pretty easy to just start from scratch though if you want to go that route. I'd recommend using 98SE + FIC VA-503+ or later mobo as this allows you to shut down the computer and then PCem automatically closes itself.

Link to comment
Share on other sites

Cool, thanks for pointing me in the right direction. I already have one of your packages L.A.P.D Future Cop so I will take a look at reverse engineering that, I never could get that game to run on modern systems, great game from my youth. :)

Link to comment
Share on other sites

Hey guys, I was wondering if any of you knew about an app that could possibly map a button on the keyboard or on a controller to a mouse to at a specific point on screen. This would be extremely help in Cemu games like Splatoon where in order to squid jump you need to use the mouse which is a hassle. Have a simple button to click it for you would be a phenomenal idea. Let me know in the comments if you guys have anything that can do this! ❤️

Link to comment
Share on other sites

Anyone help with a script? I am trying to have a Joystick button press simulate pressing F1 and F2

this is what I have, but its not working.

Joy4::
If GetKeyState("Joy4")
{
   SetKeyDelay, -1, 110
   Send {F1},{F2}
}
Return

 

Link to comment
Share on other sites

1 hour ago, Krakatoa said:

If GetKeyState("Joy4")

You only need this if needing to use a button combination.  Try this (not tested)

1Joy4::
{
   SetKeyDelay, -1, 110
   Send {F1}{F2}
}
Return

I don't know if the 1st "1" is required to tell it to look for Controller #1.  But in past tests, I know it works.

This will send a keypress to {F1} and then to {F2}.  [vs. sending  {F1}  a_literal_comma  {F2} ]

Link to comment
Share on other sites

3 hours ago, JoeViking245 said:

You only need this if needing to use a button combination.  Try this (not tested)


1Joy4::
{
   SetKeyDelay, -1, 110
   Send {F1}{F2}
}
Return

I don't know if the 1st "1" is required to tell it to look for Controller #1.  But in past tests, I know it works.

This will send a keypress to {F1} and then to {F2}.  [vs. sending  {F1}  a_literal_comma  {F2} ]

thanks, for some reason, its still not working. Maybe there's a special way needed for the Dolphin emulator

Link to comment
Share on other sites

3 hours ago, Krakatoa said:

Maybe there's a special way needed for the Dolphin emulator

Not sure exactly what your wanting to do in Dolphin.   Load a save state? Do Frame Advance [fast forward]?...  If it's something like that, you can set those in Dolphin itself.  Go to Options, Hotkey Settings.   Make sure "Device" is set to XInput/Gamepad for it to register the controller.  Then go to the tab you need and click once in the box you want to set, then press the appropriate controller button.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...