Jump to content
LaunchBox Community Forums

Recommended Posts

Posted (edited)

thanks joe1  i went with the second as the mouse does need to be clicked.  i got the coordinates but that bit with the mouse doesnt seem to do anything?

any helps is always appreciated!

Edited by d8thstar
Posted
9 hours ago, d8thstar said:

thanks joe1  i went with the second as the mouse does need to be clicked.  i got the coordinates but that bit with the mouse doesnt seem to do anything?

any helps is always appreciated!

Assuming you copied and pasted the script (vs retyping), only changed the necessary items and no errors were given...

  • it may be that the 2 second delay is too short. (i.e. not enough time for the window to fully load)
  • It may be that the coordinates are incorrect.  e.g. the coordinates are in the window vs for the whole monitor.
  • It may be that there's a command line parameter you can add to bypass that window and not have to click it at all.

You can verify the coordinates by checking the box in your Windows' Mouse Properties - Pointer Options, "Show location of mouse pointer when I press the CTRL key". Then change {LButtun} to {Ctrl}.  When you run the script this way, if all goes well, you'll see the "target rings" appear over the "Click to Start" button when you get to that part of the script.

Even if the window doesn't have focus, if it's showing and the mouse clicks in the correct location, it'll click that button.  

Posted

hi joe.

uuhhh, my mouse pointer doesnt move at all.  i start the exe which is on the left hand side of the screen.  the apps start, the mouse pointer stays where it is.

i press CTRL, it shows the circles around the mouse pointer, which hasn't moved.  and yes, i did copy / paste the script :)

if you have any thoughts...  i'll do a google, see if i can figure it out.

as always, thank you!

Posted
13 hours ago, d8thstar said:

if you have any thoughts... 

It sounds like you're compiling your ahk script to an exe file. Which should be fine.  Are you using AHK v1.1?  Or v2.0?  For using scripts with LaunchBox, I suggest V1.1.  (Ignore that it says depreciated.)

 

I don't have any more thoughts on this as in my tests here, it works. But I do have a suggestion for testing and working with scripts:

Download CodeQuickTester, place the file in a location where you won't forget where it is and use it for testing.  If you have AutoHotkey (v1.1) installed on your system (recommended), you can download the CodeQuickTester_v2.8.ahk file.  Otherwise, download CodeQuickTester_v2.8.exe.  Neither will work with AHK v2.0.

Run the app, click Edit and select Script Options.  Click Pick AHK Path and go to and select your Autohotkey.exe file. Close the window.  If you don't have AHK installed, you can point it to your /LaunchBox/ThirdParty/AutoHotkey/AutoHotkey.exe file. Close (red x) that window.

 

In the script body, type in 

DllCall("SetCursorPos", int, 960, int, 540)
Send, {Ctrl}

Then click Run.  This should move the mouse and show the circles.

image.png.dfafca993a457d674dd46fe7ba2a9b2a.png

Once satisfied that it is working, add above those 2 lines your Run....PrismXR.exe and Sleep lines and click Run.  See if the app starts and the mouse moves and shows circles (be sure to wait the full 2 seconds to see the circles).

Continue adding the rest of your script and testing until you satisfied with the results.  Don't forget to eventually change {Ctrl} to {LButton}.

Posted

thanks joe, this is driving me nuts...  taken from your coaching, this code in the tester WORKS, i see the circles pointing out where the mouse is.  when i change {Ctrl} to {LButton}, the mouse moves to the coordinates but it does not click.  second bit below, is the copy / paste of the LButton code so you can see i'm not crazy :)  and the bit at the very end, is cut and pasted from the full script.  tit opens both apps, doesn't move the mouse or hit CTRL.

 

anyway, you've spent way too much time on this, thanks for your time.

DllCall("SetCursorPos", int, 1367, int, 820)
Send, {Ctrl}

 

DllCall("SetCursorPos", int, 1367, int, 820)
Send, {LButton}

 

; Start Virtual Desktop Streamer
Run, "C:\Program Files\Virtual Desktop Streamer\VirtualDesktop.Streamer.exe"

; Start PrismXR application
Run, "C:\Users\tonys\Desktop\VR\PrismXR_Desktop_App\PrismXR\PrismXR.exe"
Sleep, 5000

; move mouse pointer to center of monitor (1920x1080)
DllCall("SetCursorPos", int, 1367, int, 820)
Send, {Ctrl}

Posted
5 minutes ago, d8thstar said:

it opens both apps, doesn't move the mouse or hit CTRL

If after the full 5 seconds has lapsed, and no circles appear, does anything happen if you [manually] hit Ctrl on your keyboard?  If so, is it (the circles) in the correct location (above the button)?

Posted
16 hours ago, d8thstar said:

circles do appear but they are right over the exe that i clicked to launch, cursor isnt moving when in the full script (but it does when doing the test of just the two lines.

Not sure what's going on then.  You might start (continue?) researching that app (Google, their forums/wiki, etc.) to see if there's a way to auto-start it without having to "click the button".  Something like a command line parameter.  

Or if there's an option to load it when Windows starts, test that to see if it loads without having to click anything.  If so, look at the shortcut they created in your Startup folder to see how they did it, and duplicate that. (then remove the shortcut)

And if nothing else, you've learned a couple new AHK script testing/troubleshooting techniques. :D

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...