Jump to content
LaunchBox Community Forums

Auto Hotkey Scripts


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 post
Share on other sites
  • Replies 634
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

I want to have a single thread for this so please share your useful and interesting AHK scripts here. Provide a short description of what the script does put the script in the post using the code

In case you want to start Xpadder.exe with an emulator's games and then exit Xpadder when exiting the game, you can add this ahk code to your emulator's AutoHotkey Script tab: Run, C:\Xpadder\Xpad

Was way too fast without any delay but it's perfect with sleep, 100. Thanks again! You guys will both get a shout out in the next release for C64 Dreams  

Posted Images

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 post
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 post
Share on other sites

Assuming you're using PCem for Windows 9x you wouldn't want that anyway as you need to shut it down properly through the start menu, not pull the proverbial plug.

  • Thanks 1
Link to post
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 post
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 post
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 post
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 post
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...