Using "Repeat From" to loop actions in a macro

Using "Repeat From" to loop actions in a macro

In the X1 Control Panel almost any output action, or sequence of output actions can be turned into a loop using the "Repeat From" action. This allows the creation of auto-fire/rapid-fire macros, or to automate some repetitive tasks.

How to add a "Repeat From" action

"Repeat From" is only used in combination with other actions as part of a macro, which are created in Expert Mode. So if you're in simple mode, switch to expert mode with the button at the bottom left of the window.

Once in Expert Mode, select the profile and input you want to add the "Repeat From" action to.  If the input does not already have a mapping, click "+ Add mappings" to create a new empty mapping to work on.


Click directly on the name of the output you want to add the repeat to. Typically this will be the action assigned to the "Press" input. But you can add repeats to the "Release" input as well if you ever need to.


If the output list is currently empty, first use the "Select Output Type" drop-down, or the "Record Keystrokes" button to add the action you want repeated.

Next use the "Select Output Type" drop-down and select the "Repeat / Wait / Stop / Alternate" category.


This will add a "Wait" action by default, so open its drop-down and change it into a "Repeat From".


The "Repeat From" output should now be in the output list as shown below.


How to configure a "Repeat From" action

The "Repeat From" action has two settings you'll need to understand to use it correctly.

Output ID#:

This field sets the target action for the repeat. This must be an action above the repeat itself, so the list of available IDs will vary depending on which position the repeat itself is in.
If there is only one action above the repeat, then the only option will be ID #1.

Typically the Output ID# will be set to #1, but sometimes it's useful to exclude some actions from the loop. In which case you will set a different value for this.

Times:

The 'Times' field sets how many times the repeat action will cause the macro to jump back to the selected Output ID. If left at its default '0' value, it will repeat infinitely, or at least until the loop is manually broken, or the profile is changed.

Example mapping

Example #1 - Repeating on output:

The following macro will result in the key sequence "AAA".

  1. The 'A' Tap is activated 3 times, not 2 as you might expect. This is because the 'A' Tap activates once before the repeat is triggered. The repeat then activates it 2 more times, resulting in 3 total.

Example #2 - Repeating multiple outputs:

The following macro will result in the key sequence "ABCABC".

  1. A repeat includes not only the target action, but also every action between the target and the repeat itself. So the full ABC sequence is repeated not just the A.
  2. The sequence activates once normally, then the repeat adds the second set.

Example #3 - Repeating some, but not all outputs:

The following will result in the key sequence "ABBBBC".

  1. The output ID is set to #2 this time, so the A key is not repeated.
  2. Only the 'B' key is included in the repeat, and the times value is 3. Which results in 4 'B' outputs.
  3. The 'C' key is after the repeat, so is not effected by it at all. It just activates once after the repeat has finished.

Example #4 - Infinite Loop:

The following will result in 'A' being repeated indefinitely.

  1. A "Times" value of 0 represents infinity. So the looped outputs will never stop. This is generally not desirable, so a mapping like this should be paired with another that stops the loop. We'll cover that in the next section.

How to stop an infinite Loop

When the "Times" field of a loop is set to '0' it will only stop when a "Stop Looping" action is used (or if the active profile is changed). There are a few different ways you can set this up depending on how you want the mapping to behave.

Start the loop with one button, stop it with another button:

This setup generally isn't recommended, as it uses two inputs when the other methods only use one. But if you want to use it you can simply add the "Stop Looping" action to a second button. It can be found in the same "Repeat / Wait / Stop / Alternate" category as "Repeat From".

Loop while a button is held down:

This is the most commonly used setup. Simply create any loop with a times value set to '0' on the "Press" input. Then add the "Stop Looping" action to the separate "Release" Input.

The final mapping will look something like this




Push the button once to start the loop, then push it again to stop it.
This setup requires use of the "Alternate" action, which allows a mapping to cycle through 2 or more actions each time it is pressed. We use an Alternate on the button release with a "Wait" action, and a "Stop Looping" action.

On the first button press the loop begins, then when it's released Alternate selects the "Wait" action that has no effect, allowing the loop to continue.
However, the next time the button is pressed the Alternate will instead select the "Stop Looping" action, ending the loop.




    • Related Articles

    • I can't change profiles using config mode anymore.

      You may be stuck on the "Global Defaults" Profile. Simply set one of the other profiles to "active" in the Swiftpoint Driver and you will be able to cycle through them again using the config mode shortcuts.
    • Using Analog functions in games without DirectInput support

      When you plug in The Z Mouse, the PC automatically recognizes it as an analog controller, meaning any game that has an analog joystick support can interpret The Z’s pitch, roll  and yaw as an analog joystick movement. If your joystick mappings are ...
    • Introduction to the Swiftpoint X1 Control Panel

      Intro The X1 Control Panel provides an easy to use interface for configuring mice in our Classic-grip Range. Including the Swiftpoint Z, TRACER and Creator. If you do not already have it installed, it is available for macOS 10.12+ and Windows 7+ from ...
    • Utilizing Deep Click

      What is a Deep Click? Deep click allows you to add a sequence of outputs that will trigger as you apply more pressure to the button. This is useful if you have a sequence of actions you use together frequently. But need flexibility in the timing of ...
    • Swiftpoint X1 Control Panel - Changelog

      Latest Version 3.0.7.0 - July 2024 Improvements & Fixes: [Windows] Allow installer to run on ARM64 systems for use via Prism. [Windows] App should now launch on boot in the background for non-admin users. This can be disabled via the "Startup apps" ...