Page 1 of 1

What is a Profile Target?

Posted: Sat Mar 30, 2019 11:29 pm
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 796 times

Re: What is a Profile Target?

Posted: Sat Mar 14, 2020 9:06 pm
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.

Re: What is a Profile Target?

Posted: Mon May 11, 2020 10:23 am
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.