What is a Profile Target?

Post your question or observations here.

Moderator: DevRuss

Post Reply
DevRuss
Journeyman
Posts: 224
Joined: Wed Mar 27, 2019 12:59 am

What is a Profile Target?

Post by DevRuss »

To be able to send joystick buttons, mouse movements and clicks and keyboard keystrokes, you need to define Where to send them. This is known as a target.

Windows always knows where to send this input. It always sends it to the 'active' program/application/game. You see it all the time. Click on this window and your keystrokes go there. Click on that window over there and your keystrokes go there.

For each profile, you can specify which program will be the target. So when you send some text via script, it will go to that program and not any other program. If you don't specify a target, or enable the target, the input will not be sent. Well that isn't technically correct. Joystick axis data will be sent. But everything else - no.

Example
A good way to get to know CMJ keystrokes is to output some text to Notepad. Let's try it:
1) Start up Notepad.
2) In CMJ, go to your profile in the picklist and right-click on it for a menu, or go to the Profile menu and select 'Edit Target...'.
3) Select 'Untitle - Notepad' from the list and click Ok.
4) In the same menu, put a checkmark beside 'Enable Target'.

Note: The targeted app is saved in the profile .cmjson file, but whether it is enabled or not isn't. The enabling is for all profiles, not just the current profile.
ProfileTarget1.png

Try the following profile which uses a profile target to send a 'Hello World!' to Notepad.
My Test Profile.cmjson
(25.77 KiB) Downloaded 667 times
Russ - Tetherscript Developer
Windamyre
Posts: 1
Joined: Sat Mar 14, 2020 8:49 pm

Re: What is a Profile Target?

Post by Windamyre »

Quick question about Profile Targets:
The target seems like it might be a bit too specific. For example, when used with any program who's name includes a filename the targeting breaks. Even in the example you use, saving the file as text.txt changes window name from 'Untitled - Notepad' to 'text.txt - Notepad' and the targeting no longer works.

Is there anyway to make it so that the Profile will target the active window? I have a few pieces of software I'd planned to integrate the SpaceMouse with using ControlMyJoystick such as Gimp and Daz Studio but each modifies the window with the file name.

Thanks in advance for any feedback.
DevRuss
Journeyman
Posts: 224
Joined: Wed Mar 27, 2019 12:59 am

Re: What is a Profile Target?

Post by DevRuss »

>> Even in the example you use, saving the file as text.txt changes window name from 'Untitled - Notepad' to 'text.txt - Notepad' and the targeting no longer works.
Unfortunately, this is a Notepad quirk. No workaround is available, other that when you open notepad, save right away, then set it as a target in CMJ so that it uses the correct titlebar name.

>>Is there anyway to make it so that the Profile will target the active window? I
Not really, because often CMJ is the active window, especially when you are testing your profile.
Russ - Tetherscript Developer
Post Reply