Using AHKv2 to Copy/Clone Keystrokes to 1 or 2 windows at the same time (Parsec)

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
SCM_Astrea
Posts: 2
Joined: 25 May 2024, 00:07

Using AHKv2 to Copy/Clone Keystrokes to 1 or 2 windows at the same time (Parsec)

25 May 2024, 03:34

Hello, I'm new to AHKv2, and I'm trying to create a script that will allow me to copy and/or clone my keystrokes to another window using Parsec, an application that is very similar to Remote Desktop or TeamViewer. The primary keys I will be using will be the W, A, S, and D buttons. For more context, I am using two PCs, with one acting as the controller for the second one. Each PC will be running Minecraft, and my end goal is to be able to control both PCs by utilizing AHK to interact with the Parsec Window located on the first PC. One key feature I want my AHK script to possess is the ability to choose between interacting with one specific window or all designated windows using a hotkey. I would appreciate it if anyone could give me any coding examples or other information I could use to achieve my goals. I have tried searching for help and information using YouTube, but unfortunately the videos that appear are either for AHKv1 or not quite related to what I am looking for.


"Error: Target window not found."
My code, while incredibly basic, does work with TeamViewer, but unfortunately, AHK is unable to detect Parsec. This is an issue since Parsec is currently the best remote access software I can find that will allow me to actually move my character, unlike TeamViewer. I have tried using Window Spy, but it seems it cannot detect Parsec either, as it only shows details of the last known window my mouse cursor hovered over. 

Current Features I plan to use in the future:
-Hotkey Symbols
-Gosub
-Label
-Variables
-If (expression)
-Boolean
-Operators
-SetTimer
-GetKeyState
-Send
-ControlSend


Please let me know if I'm on the right track, as well as suggest any tips or tricks I could use in the comments. Any help would be greatly appreciated.

Code: Select all

#Requires AutoHotkey v2.0

W::
{
ControlSend "{W}" , "Parsec"
}
gregster
Posts: 9114
Joined: 30 Sep 2013, 06:48

Re: Using AHKv2 to Copy/Clone Keystrokes to 1 or 2 windows at the same time (Parsec)

25 May 2024, 10:24

I am no gamer and I don't know the remote software, but there are few posts discussing Parsec and related problems: search.php?keywords=Parsec

Code: Select all

ControlSend "{W}" , "Parsec"
I would guess that Parsec is rather (part of) the wintitle and not the control's ClassNN or text, if at all.
Btw, did you try to run your script as admin?
SCM_Astrea
Posts: 2
Joined: 25 May 2024, 00:07

Re: Using AHKv2 to Copy/Clone Keystrokes to 1 or 2 windows at the same time (Parsec)

25 May 2024, 21:12

gregster wrote: I am no gamer and I don't know the remote software, but there are few posts discussing Parsec and related problems: search.php?keywords=Parsec

Code: Select all

ControlSend "{W}" , "Parsec"
I would guess that Parsec is rather (part of) the wintitle and not the control's ClassNN or text, if at all.
Btw, did you try to run your script as admin?
Yeah I tried playing around with running my script as admin and have swapped the "Parsec" value between WinTitle and Control. The only difference between switching the two seems to be that when Parsec is placed in the WinTitle Parameter AHK can "find" the window but can't actually interact with it unlike when I am using TeamViewer.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: XMCQCX and 59 guests