GremlinEx feature usage guide¶
This guide covers the current m77 workflows. Use it to set up a profile, connect inputs to actions, and test the result. The linked user guides provide the detailed controls and worked examples for individual features.
Set up an m77 profile¶
- Open Options → Modules and enable the optional modules you need. Restart GremlinEx if prompted. See Modules and themes.
- Create or open a profile, select its edit mode, and select the source device and input. For configurable devices such as Keyboard/Mouse, OSC, Voice, and States, add the input first.
- Add a container and then an action. Start with a Basic container for a direct mapping; use Sequence when commands need separate steps and timing.
- Configure the destination. Examples include a vJoy control, a keyboard shortcut, a state, or a sound or speech cue.
- Save the profile. Start it with the activation control, trigger the source, and check the destination in the input viewer or target application.
- Stop the profile before editing the mapping. When moving the profile to another machine, copy its XML file, companion JSON file, and referenced assets together.
For additional input surfaces, follow the setup steps for Stream Deck, Overlay pages and web panels, or Voice recognition. For visual axis processing, use the AFCS designer.
Command line switches¶
GremlinEx (GEX) can be started with a number of options. See Command-line options.
Concepts¶
Devices¶
A device in GremlinEx is a hardware or virtual device used as input. It can be a joystick or game controller. A device can also be a state list, a keyboard/mouse, MIDI or OSC input mapper, and special devices. They appear as tabs in the user interface below the toolbar. There is one device per compatible input detected by GremlinEx based on what you have connected to the computer, along with any referenced but nor currently connected device, and special devices like settings or plugins.
Inputs¶
Each device (non special) has a number of available inputs. An input for a joystick can be a hat, button or axis. Some devices, like keyboard/mouse and OSC, do not have defined inputs because inputs are customizable for each profile for these devices. If you want to trigger an action on a keys or a mouse button, an input mut be defined for the specific key(s) or mouse buttons in the keyboard device. Similarly, if you want to trigger on receiving an OSC network message, an OSC input must defined in the OSC device.
If you would like to define a new state in the profile, that state needs to be defined as an input in the state device.
To use vJoy or Maestro joysticks as inputs, select them under Profile Settings > Virtual as Input > Configure.... Each enabled device appears in its own input tab. Maestro inputs must be local joysticks available through DirectInput. These selections are saved in the profile.
To use Tobii Eye Tracker 5 head tracking, calibrate the tracker in Tobii Experience and run Tobii Game Hub with a game profile that sends head tracking over UDP. In GEX, enable Tobii Head Tracking under Options → Modules, match Tobii UDP port to the Game Hub port (default 4242), and restart GEX. The receiver listens on this computer at 127.0.0.1. The Tobii Head Tracking tab appears on receipt of the first valid packet. Tobii Game Hub setup
Map X, Y, Z, Yaw, Pitch, and Roll using the same controls as other joystick axes. GEX scales translation over ±50 cm and rotation over ±180° before applying the configured input filters and curves. If the stream stops, the axes return to center after 750 ms. The Game Hub stream carries head pose. Eye-gaze coordinates are a separate stream.
To monitor all six axes, choose the current-axis view or the axis timeline under Tobii Head Tracking in Tools → Input Viewer. Tobii appears in the list when Game Hub begins sending tracking data, including when the viewer is already open.
For eye gaze, calibrate the tracker for your primary Windows display. Run GEX Bridge 0.1.4 or later in your signed-in desktop session with --Osc:TobiiGazeEnabled true. GEX Bridge reads Tobii.Interaction from the local Tobii installation. In GEX, configure the local bridge address and receive port, enable Tobii Eye Gaze under Options → Modules, then restart GEX. The Tobii Eye Gaze tab and its Input Viewer panels appear after the first valid gaze point. Gaze X increases to the right and Gaze Y increases upward. The axes return to center when the bridge stops reporting valid gaze.
It is generally not recommended to use the same VJOY device both as input and output concurrently in the same profile. Outside of a performance degradation versus using, for example, states (for virtual input needs) due to the overhead involved, it becomes exceedingly easy to create loops and race conditions when using the same VJOY device both as input and output from the same process. This is known in extreme cases to cause VJOY API issues due to the internal locking of the VJOY software, for example, making the device unavailable. The virtual input feature for vJoy is meant to be used when the writing is done via another software that sends to VJOY is needed, to trigger something from GremlinEx as a result. Generally speaking, only one process should write to VJOY, and another process read from VJOY. These limitations are external to GremlinEx. This said, with careful planning and understanding of the above limitations, it is possible to use the same VJOY device for input and output in the same profile. This is an advanced feature and in general the preference is to use an alternative setup where possible using one of the other GrmelinEx features, such as states.
Input Filter¶
Use input visibility filters to show the joystick axes, buttons, and hats relevant to the profile. Hiding unused inputs reduces UI clutter and the resources needed to display large devices, especially vJoy devices used as input.
Hiding an input keeps its mappings intact. Those mappings still execute when the profile is active; show the input again when you need to edit them.
The State Device also provides search, category, and attribute filters to help manage large state lists. See Organize states.
Save the profile after changing its visibility filters. To reduce noisy axis events, configure the separate axis input filter.
Filter Configuration¶
Open the device's input filter dialog and select the axes, buttons, and hats to display. Selected inputs are colored; hidden inputs are gray. Mapping indicators help identify inputs already in use, and operating a control highlights its corresponding input.
The global filter controls also let you restore default visibility or select mapped inputs across joystick devices. In the input viewer, Select Used selects inputs and outputs used by the current profile, making it easier to monitor a specific mapping.
Triggers¶
Inputs generate triggers. There are two types of triggers. Linear and momentary.
Linear¶
Axis or sliders generate an event whenever the input value is changed. The typical range of these values is normalized in GremlinEx to -1.0 to +1.0 as a floating point number. Center is 0.0. When a linear trigger is issued, the value is passed on to each mapping to process that value. If the input device has a curve or calibration applied to it, the value passed to mappings is already curved/calibrated.
Momentary¶
For buttons and keystrokes, a momentary trigger is issued. This is a "press" or "on" event, followed by a "release" or "off" trigger. Mappings receive these events and process them in their own way.
Autoreleases¶
Some inputs like rotary encoders and some hats only trigger a trigger when the input is changed. There is no separate "release" although GremlinEx will generate virtual releases in many cases automatically for you. For example, hats will issue a "press" when the position is changed, and GremlinEx will typically issue a "release" for the old position so mappings can turn off.
This is important because most mappings rely on two triggers to function properly - they need both a "press" and "release.
GremlinEx will usually generate an autorelease trigger for inputs that do not have one, however this may be configurable depending on the input and the mapping through options selected in the profile.
Input Detection¶
GremlinEx monitors the DINPUT (DirectInput) API for notification from the device a button, axis or hat was changed. The received data is converted to a normalized range of -1.0 to +1.0 with the center position being 0.0. DINPUT data includes physical devices as well as VJoy data (when VJoy devices are also used as input).
GremlinEx monitors the Windows API for keyboard inputs. Inputs must be defined in the Keyboard/Mouse device for GremlinEx to actually respond to keystrokes. GremlinEx handles all keys Windows can recognize, including keys that are not typically visible on a standard keyboard like F13 to F24. GremlinEx can trigger on latched keys (any number of keys that are pressed together) which goes beyond the modifier keys. For example it is possible to map non standard key combinations like left-alt + F1 + F2 + F3 together to trigger a specific mapping. GremlinEx uses scan codes and extended codes. GremlinEx is not localized for any software but usually expects the QWERTY US English keyboard layout.
GrmelinEx monitors the Windows API for mouse button and wheel inputs. GremlinEx does not monitor mouse movement. The mouse button and mouse wheel input are also defined in the Keyboard/Mouse device as a combined input that handles both mouse and keyboard inputs.
GremlinEx monitors UDP for OSC messages when the OSC module and listener are enabled. Configure the incoming address, parameters, and port in the OSC device. Use a loopback address for software on the same machine or the receiving machine's LAN address for another computer. Match the sender's destination port to GremlinEx's listen port and allow the traffic through the firewall when needed.
GremlinEx monitors MIDI inputs via the midi interface. Note that this interface can be networked using certain MIDI open source tools (see resources). It is recommended to use OSC instead of MIDI in most cases, because it is signficantly simpler to setup than networked MIDI and OSC in general is much more advanced and has higher resolution for axes and sliders. You can monitor MIDI traffic via third party free utilities listed in the resources section.
The direct Stream Deck bridge supplies button and dial events without Companion or OSC. The Voice module turns recognized phrases into configurable inputs. Interactive overlay controls can operate writable vJoy controls and ordinary states, and an overlay OCR widget can produce mapped input events from matching captured text. Enable and configure the corresponding module before adding these mappings.
Outputs¶
Xbox-compatible controllers show their Windows device name followed by the XInput slot, for example Xbox One Controller (XInput 1). When Windows provides multiple names, GEX shows the first with a +. Hover over the device tab to see the other names. If Windows provides no usable name, GEX shows XInput Gamepad followed by the slot number. Bindings follow the Windows slot. If a profile used an Xbox controller before XInput support, rebind it to the corresponding slot. The left and right triggers appear as separate Z and Rz axes.
Use Map to vJoy for virtual joystick axes, buttons, and hats, or Map to GamePad for a virtual Xbox controller when its required driver is installed. vJoy is optional for profiles that use other output types; configure a vJoy device before selecting it as a destination.
Use Map to Keyboard/Mouse Ex for keyboard combinations and mouse commands. Windows can restrict input sent to an application running with higher privileges, so check the target application's privilege level if it does not receive the output.
OSC actions send UDP messages to a configured host and port. Use loopback for a local receiver or the destination computer's reachable network address for remote output. The remote control and KVM features provide additional routing between GremlinEx machines.
Use Map to State to update profile flags, Map to Stream Deck to control deck pages, or Map to Overlay to control overlay pages, widgets, and variables.
GremlinEx will send MSFS commands via the Microsoft/Asobo SimConnect API, or the GremlinEx WASM module if installed to execute MSFS calculator code. Note that many commands are not supported by the default SimConnect SDK, especially when it comes to add-on third party aircraft, and the WASM module should be installed in the simulator's Community folder before running GremlinEx or this functionality may not work.
The Play Sound/TTS action plays WAV/MP3 files and speech generated with local TTS or Edge-TTS. New actions follow the current Windows default audio output; each action can instead target a fixed playback device. WAV is a useful first test for low-latency sound cues. Playback can overlap or use the shared audio queue's blocking controls.
Additional outputs can be added via a custom user plugin.
Manual output to VJoy / Injector¶
Open the input viewer to manually operate vJoy buttons, hats, and axes while testing an output device. Use Select Used to focus on destinations referenced by the current profile. Manual output is useful for checking a game binding before adding the full mapping logic.
Manual output to states / Injector¶
Ordinary states can be changed manually in the input viewer as well as through Map to State. Use the viewer's state filters to find a state by name, category, or attribute. Expression states are derived from other states; change their source states to test the expression.
Edit vs Run (active) profile mode¶
Start the profile to execute its input mappings, containers, and conditions. Live input indicators, action preview controls, and manual output tools can be used while editing, but testing an entire mapping requires an active profile.
Stop the profile before changing its mappings. Profile stop also ends active runtime tasks such as sequences and releases managed outputs.
Mappings¶
A mapping represents a set of containers and actions to execute whenever the input is triggered. There is one mapping for each profile mode, so you can have each input do different things depending on the current profile runtime mode.
A mapping contains one or more containers.
Containers¶
Once an input is defined (manually or automatically depending on the type of device it is), you can select that input and add a container to it. A container is an entity that contains one or more actions. There are multiple container types, each with unique capabilities and options that control how the mapping happens.
Actions¶
Actions are specific entities that actually produce output. Actions are contained by containers.
GremlinEx actions typically fall in two categories:
- actions that work on a linear input (like an axis or slider)
- actions that work on a momentary input (like a button or hat)
If you select an input, and you do not see an available action, it's likely because that action does not work with the selected input type.
Actions are self contained, meaning that each action functions independently of other actions, which makes it possible for the same action to be added multiple times to the same container for example.
The main action to map to a Vjoy device is called Map to Vjoy. There is an older, legacy mapper called Remap for compatibiliy with the original Joystick Gremlin, however it's not suggested it gets used for new profiles because of the significant capabilities of Map to Vjoy.
Axis Curves¶
All axis inputs and most action output to a Vjoy axis can have curves applied to them that modify the response of the linear input. Curves are cubic or Bezier and can be hand-drawn if needed.
Curve applied to an input apply to the axis for that device across the entire profile. This is helpful to deal with deadzones and response curve for very sensitive devices.
In most cases, you will want to apply a curve in the action directly, specifically, Map to Vjoy. You can also apply curve actions to a container, however this is mostly a legacy feature at this point.
Conditions¶
Conditions apply to containers and actions. A condition is a pass/fail logic gate applied to the input determines if an action should execute or not. A condition applied to a container appies to all actions it contains. Conditions applied to actions only apply to that action.
Conditions can check for a key press, a button press, an input axis being in a specific range. Conditions can also check for a state.
Conditions are evaluated as blocks. If a mapping has nested conditions, they will all be evaluated based on the mapping hierarchy. Container conditions are evaluated before action conditions.
If a condition fails, the processing of the mapping is aborted.
It can be difficult to diagnose why a mapping does not execute when it is expected to, GremlinEx has three verbose modes dedicated to showing this information at runtime in the log file. These are turned off by default because they generate a large amount of log data. The Exec and Extra verbose mode will show the execution tree, and the Condition verbose mode will add to the tree the pass/fail status for each condition and the sequence followed.
Logical conditions that check for certain input states, values or ranges can be applied to all container actions as a group (container level), or individual actions contained within the container. This allows you to further manage when and if actions are executed.
Conditions are set via the condition tab of the container (right side of the UI).
Each container has a top level condition that applies to the entire container. If this condition fails, the others will not be evaluated.
Each action in the container can have a condition as well, and these conditions only apply the action. If that condition fails, only that action will not be executed.
Types of conditions¶
| Container | Description | Typical Use-Case |
|---|---|---|
| Joystick condition - Axis | The condition looks for a physical input axis to be in a specific range | |
| Joystick condition - Button | The condition looks for a physical button to be pressed, released, or changed. | |
| Virtual Condition - Axis | Checks whether an axis on a GEX Maestro or vJoy device is in a specific range. | |
| Virtual Condition - Button | Checks whether a button on a GEX Maestro or vJoy device is pressed or released. | |
| Action condition | The condition looks at the state of the input trigger | |
| State condition | The condition looks for a state value. | This is extremely powerful because a state can itself derive from other states, making complex boolean compound conditions possible. |
| Keyboard condition | The condition looks for a specific key press | |
| Mode condition | Thje condition looks for the profile to be in a specific mode |
Condition results¶
All conditions have a ruleset applied to them.
| Ruleset | Description | Typical Use-Case |
|---|---|---|
| Any | Any condition passing results in a PASS. | Used for multiple choice conditions when one out of many is needed to succeed. |
| All | All conditions must pass to result in a PASS. | Used when all conditions need to be met. |
Conditions are evaluated top down. All stops at the first failed condition; Any stops at the first passing condition. If the ruleset does not pass, the affected container or action does not execute for that event.
Container conditions apply before the actions inside that container. Action conditions affect only their own action. When a condition can change while a button is held, check that release events still reach outputs that need them. See the worked state-condition example.
Usage considerations¶
Conditions are often necessary and a natural part of any complex mapping scenario, and are a core feature of GremlinEx.
Conditions are time consuming to setup, and they are expensive to process at runtime (expensive in relative terms as GremlinEx is heavily focused on eliminating any latency in processing mappings). Conditions are available and should be used, with the additional design consideration that there are (usually) multiple ways to filter output in GremlinEx, and the overall goal is to minimize the need for conditions if the same goal can be achieved in other ways.
GremlinEx at runtime uses a quick branching execution graph to determine what needs to be executed, and as such, it's best to place conditions at the highest level possible: container conditions are preferrable to action level conditions.
It is also recommended to use states where possible as a condition, because the state system is very efficient compared to conditions. Expression states can often replace multiple conditions using boolean logic which simplifies the number of conditions that need to be evaluated. The State Container includes a built-in test for a state eliminating the need for a separate condition.
As part of the profile design, also consider reversing conditions if it means using fewer conditions overall.
Startup state¶
Choose how outputs and states should be initialized when the profile starts:
- For a maintained switch, use Map to State's Input startup setting to synchronize the state with the hardware. Use a fixed On or Off setting when the profile should start with a known flag value. See startup and stop settings.
- In Map to vJoy, choose the relevant startup synchronization or initial output value for the selected mapping mode. A synchronized throttle sends its current position when the profile starts, so check the lever position before activation.
- Use the Profile Start input in the Mode/Profile device for startup commands and Mode Enter for commands needed when entering a mode.
Test startup with switches in both positions, then stop and restart the profile. Check that states, virtual controls, and the target application agree.
User Interface Overview¶
Menu¶
The menu offers typical options to create, save or load a profile, access tools and options available in GremlinEx.
Toolbar¶
The quick action toolbar below the menu offers buttons to quickly save, load or run a profile. Quick actions also includes the input viewer dialog, which shows "live" inputs, and quick access to GremlinEx's options.
Modules and themes¶
Open Options → Modules to enable optional features such as the Stream Deck bridge, Overlay, AFCS, Voice, MIDI, OSC, and Octavi support. Enable the modules used by the profile and restart when prompted. A module's device tab and configuration controls may be hidden while it is disabled.
For example, enable Voice before configuring spoken commands, or Overlay before creating an on-screen panel. Keep unused modules disabled if you do not need their background services or model resources.
Appearance options include Windows, Light, Dark, and Custom themes. Use Custom Colors... to edit the custom palette. The custom theme is experimental; restart when requested to apply appearance changes fully.
Edit mode¶
To the right of the toolbar, a drop down with the current edit mode for the active profile is displayed, which lets you change the active edit mode. It also includes a button to bring up the mode options for the profile to edit/change available modes and their relationships, as well as profile options.
Device list¶
The top of the user interface below the toolbar is the device list, shown as a list of tabs. The list shows all detected devices, as well as special devices (like OSC), keyboard, modes, and some general options to setup user plugins and profile options.
Click on a tab to select the device as the active device. You can also use the mouse wheel to scroll the tabs left or right which will also select a new device tab.
Physical Joystick devices¶
Joystick devices and "console" game controllers will appear with ther DirectInput name, one per tab. Clicking on each tab will bring up a list of device inputs (axis, button and hat) in the left panel. Any mapped action will appear on the right panel.
Virtual (VJOY) Joystick devices¶
Virtual VJOY devices will also appear as a tab if they are set in input mode (enabled in the settings tab). GremlinEx allows VJOY devices to be used both as input and output concurrently. GremlinEx names the VJOY devices using their axis/button/hat count and the VJOY device number (1 to 16).
As each VJOY device must be different from the other when configured in the VJOY software, each name will be different because each device will have at least a different axis, button or hat count.
Special devices¶
Special devices in GremlinEx are non-joystick devices, or configuration devices.
| Device | Description |
|---|---|
| Keyboard/Mouse | Define keyboard combinations, mouse buttons, and wheel inputs. |
| Mode/Profile | Map profile start/stop and mode enter/exit events. |
| OSC | Map incoming OSC messages and send feedback to panels. |
| MIDI | Map messages received from MIDI ports. |
| States | Define ordinary states, expressions, categories, attributes, and exclusive groups. |
| Stream Deck | Map direct button and dial inputs and design virtual pages. |
| Overlay | Design on-screen panels, interactive controls, and browser panels. |
| Voice | Define phrases and configure microphone recognition. |
| AFCS | Build visual axis-processing graphs. |
| Octavi IFR1 | Map panel inputs and control its LEDs. |
| Settings | Configure profile-specific input and startup settings. |
| Plugins | Attach Python user plugins to the profile. |
Optional device tabs depend on the enabled modules. Direct Stream Deck devices also depend on the bridge connection and the devices reported by the Elgato software.
Device List¶
Available devices are down as a tab near the top of the interface. Physical, virtual, and special devices will show in the list.
Device Order¶
The list can be re-ordered by dragging and dropping device names to the desired location. This setting will be persisted. Note that the order of devices does not change the order of devices as seen by Windows. Devices in Windows cannot be re-ordered, but GremlinEx will let you change the order visually based on your preference.
Device Visibility¶
Devices can be hidden if they are not used to declutter the UI and improve performance. While GremlinEx will not load a device until it is selected, performance and memory usage decreases when fewer devices are displayed. To determine which devices are visible, you can call up the visible device dialog from the tools menu, or from the device context menu.
Device visibility is persisted by profile. Save the profile after making changes.
Device appearance¶
Each device tab will include an icon if the device is mapped. The icon will be solid if the device has a mapping in the current profile edit mode. The icon will be hollow if the device has a mapping in a different profile mode.
Disconnected devices will show with a disconnect plug icon.
Disconnected devices¶
If a device was saved to a profile, the profile is loaded, and the device is no longer detected, GremlinEx will indicate the device is not currently available with a disconnected flag as shown above. The device can be reconnected by plugging it back in, or deleted via the context (right click) menu. Disconnected devices are normal when opening a profile created on a different machine as device hardware IDs will be different.
It is possible for the disconnected device to have the same name of a current device if the device has a different hardware ID from what is currently detected.
Tip: copy mapping from one device to the other¶
You can copy all mappings from a disconnected device to another connected device using the right-click context menu. This is helpful if you changed devices but wish to copy the mappings from one to enother. GremlinEx will copy one to one inputs that are in the disconnected device, and also found in the target device.
You can also save mappings to a template, and load that template back into another device, which is similar although this lets you create templates persisted to a disk file for later use in other profiles.
Input area¶
The left of the user interface (UI) is the input area. It shows a list of available inputs on the currently selected device.
Input lock/unlock¶
Each input can be locked, which prevents inadvertent editing of its mappings.
Linear inputs¶
Linear inputs indicate an axis type input is detected. The input can change values. Examples of linear inputs are a joystick axis, a slider, a fader, or rotary knob.
Linear inputs that have multiple axes, such as an XY pad, will show as one input per axis.
Linear input repeaters¶
GremlinEx can display a repeater bar graph that shows the current state of the input, and in some cases, transformations applied to that input. This lets you visualize in real-time the inputs.
Momentary inputs¶
A momentary input is an input that typically has two states - pressed or released such as a key or a button. A momentary input can also be held in which case it will keep its pressed state until it is released.
Encoders are also typically momentary but they have multiple positions. In GremlinEx, an encoder will typically show as two inputs, one to increase, one to decrease.
Hats¶
Hats are a special type of momentary input. GremlinEx supports eight (8) positions per hat (north, north-east, east, south-east, south, south-west, west and north-west). The center position is the released state for a hat. A hat with a push (or pull) function will show as a separate momentary input for the function.
Keyboard¶
The keyboard is a momentary input with a key either pressed or released (known as a key make or a key break). In the above example, the key sequence alt-c is selected.
Mouse¶
In GremlinEx, mouse inputs are available through the keyboard/mouse device. GremlinEx supports all five mouse buttons, and adds four more for wheel up/down and wheel left/right respectively. The left button is mouse 1, the right button is mouse 2, the middle button is mouse 3. Buttons 4 and 5 are sometimes known as the forward and back buttons on the mouse.
Available inputs¶
For controller devices, such as a hardware joystick connected to the computer or VJOY virtual controllers, the list of inputs is defined by the controller and cannot be changed. The list is defined by the controller.
For configurable devices, such as OSC and the keyboard, the inputs must be user configured and can be added, edited or removed.
Mapping area¶
The right of the user interface (UI) is the mapping area. It shows a list of configured mappings for a given input. GremlinEx organizes mappings using containers and actions. A mapping will include at least one container, and the container in turn contains one or more actions. The container type and action type determine what GremlinEx outputs when the input is triggered.
Containers and actions mapped to an input will appear in this area. In this case, we have a gated axis action mapped to an axis input.
Profiles¶
Save each profile as an XML file. The default user folder is %USERPROFILE%\Joystick Gremlin Ex; profiles can also be saved to a location you choose.
The XML stores device mappings, modes, states, and profile settings. Additional profile data, including overlay layouts, uses a companion file with the same base name and a .json extension. Keep both files together when copying or sharing a profile, along with referenced sound files, images, and user plugins. Generated speech also uses a managed cache; check that speech assets are available on the destination machine.
The profile contents can be view in any text editor. While possible, it is not recommended to manually edit the XML file outside of GremlinEx. If editing manually, please observe that:
- GremlinEx can fail if it encounters invalid XML data as a result of an edit.
- Most entities in the profile have a unique ID that cannot be duplicated. Every entity added manually must have its own unique ID. IDs are not random - they are GUIDs (globally unique identifiers) to ensure they are unique.
- Some of these entities keep references to other entities by ID so linkage can easily be broken with cut/paste in the XML
- GremlinEx may change the XMl format depending on versions although it is designed to load older versions and "add" the new information if needed when saving.
- Unexpected errors in the XML may crash GremlinEx on load
Saving a profile¶
Saving a profile saves (persists) the profile data to a file. Very few actions in GremlinEx are saved automatically so it's a good idea to save often when you make modifications.
When replacing an existing profile, GremlinEx keeps backups according to the count configured in Options. Older copies are removed when that count is exceeded. Backups are also organized by GremlinEx version so a profile saved with a newer format can be recovered for use with an earlier build. Keep the companion JSON and external assets with any profile copies you maintain separately.
Loading a profile¶
GremlinEx offers a list of recent profiles used to load, listed in order of last use, in the file/open recent option.
When loading a profile, if GremlinEx detects changes were made to the current profile, it will prompt you to save the changes first. Loading a profile does a reset of all inputs and GremlinEx will attempt to reload the exact device and input that was selected the last time the profile was loaded.
Load times are typically speedy, however large profiles with lots of modes and inputs may take some time to load because of the internal processing that happens.
Deleting a profile¶
GremlinEx does not offer in the UI the option to delete a profile. To remove a profile, you can open File Eplorer to the GremlinEx storage folder via the menu (Actions/Open GremlinEx folder) and delete the file manually.
Templates¶
Templates holding setting for containers and actions can be saved to disk as template (XML) file. The file only contains container and action information. Templates do not have any input configuration in them. Templates can then be loaded to another input, or profile, to build a library of mappings. This is particularly useful for mappings that have OSC or MSFS data as these can get time consuming to setup, although templates can also be seen as a persistent copy/paste of containers and actions. A benefit of templates is they are input agnostic, although care should be used to ensure that a template for a button isn't loaded into a linear (axis) input, and vice versa as that could cause errors or warnings.
Devices¶
A device is a physical or virtual controller recognized by GremlinEx as an input controler. Examples of devices are joysticks and panels connected to the computer, or a virtual device, such as an OSC input message or a virtual joystick (VJOY).
GremlinEx will list the devices it finds at the top of the user interface in a series of tabs.
Devices that are referenced in a profile but not currently avaialble will show in a warning color with a disconnected icon next to them. This means device information was read from a saved profile, but the device is not currently visible to GremlinEx.
This can happen if the device is disconnected, or when importing a profile from another machine that had different device identifiers so GremlinEx cannot find them on the current machine.
Physical (HID) controllers¶
A physical device is a controller currently attached to the computer and that has buttons, axes, or hats in any combination. Such devices are usually connected via USB.
Based on the DirectInput specification, controllers can have up to eight (8) axes/sliders, up to 128 buttons and up to four (4) hats.
The device will only show if it is an HID compliant game controller - so joysticks, console game controllers, and devices using Arduino or Rasberry Pi (setup as HID controllers) will be displayed. HID devices that are not reporting as an HID controller and thus not visible to DirectInput will not be visible in GremlinEx.
GremlinEx will only work with controllers that report through DirectInput (so not the XBox API for example). All controllers compatible with PC will show in DirectInput. All controllers compatible with XBox will not show, unless they run in PC/Windows compatibility mode.
Virtual controllers¶
A virtual controller is a software controller that exists at the hardware driver level. VJOY is one such example of a virtual joystick driver, with up to sixteen (16) virtual devices that can be configured in VJOY provided each is different from the other in terms of axis, hat or button count. Another example is VIGEM, a virtual x-box 360 controller that is similar to VJOY but for a game (console) controller.
Profiles that use keyboard, mouse, states, audio, or other destinations can run without a configured vJoy device. Install and configure vJoy when you need virtual joystick output.
Maestro Bridge/HIDMaestro support is under development and is disabled in the current m77 release. Continue to use the released vJoy setup for virtual joystick mappings.
Keyboard and mouse¶
GremlinEx will display a special keyboard device that groups the functionality of a keyboard and mouse. Note that mouse axis input (mouse movement) is not currently supported as input (it is supported as output).
OSC and MIDI devices¶
GremlinEx will display a device for processing OSC and MIDI messages sent to the local machine. The messages can originate locally or from a remote machine.
While MIDI and OSC are protocols associated with musical instruments, they are also sophisticated stage controllers with touch-screen surfaces or physical sliders, dials, button and touch pads. GremlinEx can use signals from these devices to control a game.
Loopback device¶
Use Loopback to share an axis or button between mappings within a profile. Define controls in the Loopback tab, write to them with Virtual Remap, and read them with joystick conditions. The Settings tab lets you assign startup values. Loopback Device User Guide
State device¶
Use the State Device User Guide to create states, expressions, categories, attributes, and mutually exclusive groups. Use Map to State to connect physical controls to ordinary states.
Use categories to organize related states, attributes to select flags across categories, and exclusive groups when only one state in a group should be On. Map to State can target a single state, an explicit list, categories, or attributes. Expression states combine existing flags with and, or, not, and xor.
To build a chain, map an input to an ordinary state, then attach another Map to State action to that state's input. To gate another command, add a state condition or use a State container. Follow the worked examples for triggering another state and using a state as a condition.
Currently states are either pressed (on/true) or released (off/false) and function like a virtual joystick button. When a state has mapping, the actions and containers mapped to it will see the input as a joystick button, so all containers/actions able to use momentary inputs can be mapped to a state.
States can be set to auto-release after being set. If this option is selected, whenever the state is set, it will start a timer. If the timer lapses, the state's value will be reset based on the auto-release mode.
| Mode | Action |
|---|---|
| Toggle | The state's value will be toggled upon auto-release |
| On | The state will be set to on upon auto-release |
| Off | The state will be set to off upon auto-release |
States are read by conditions and specifically the state condition.
In GremlinEx, states can be mapped via the State Device, the "map to state" action is used to clear, set, toggle or pulse a state, and the state condition is used to determine, based on state, if a container or action should execute or not.
Octavi IFR1 device¶
The Octavi IFR1 device is supported by GremlinEx directly at the HID layer. The device offers a number of button actions and functions in GremlinEx like a joystick. The companion Map to Octavi IFR1 action lets GremlinEx set state and LEDs on the Octavi.
Stream Deck device¶
The direct Stream Deck bridge connects GremlinEx to the Elgato Stream Deck application. Keep the Elgato software running; it manages the physical devices. Companion and OSC are optional alternatives and are not required for this connection.
- Enable the Stream Deck bridge in Options → Modules.
- In Options → Stream Deck, use Install Stream Deck plugin… to install the companion plugin.
- In the Elgato software, add a JG Ex Button or JG Ex Dial to the deck layout.
- Select the connected deck's tab in GremlinEx. Configure its virtual pages and select a button or dial input to add containers and actions.
- Start the profile and test the physical control. Use Map to Stream Deck when a mapping should change pages or return to the previous page.
The bridge uses a local WebSocket connection, with port 9020 as the default. Page designs can include state-based feedback so a key reflects profile state. See the Stream Deck guide for installation, layout design, connection checks, and page actions.
Overlay pages and web panels¶
Enable the Overlay module, then use the Overlay tab to create pages containing controls, labels, images, and indicators. Layouts belong to the profile and are stored in its companion JSON file. Use the overlay export/import controls when transferring layouts separately.
For an on-screen panel:
- Create a page and add the required widgets in the designer.
- Choose an on-screen background mode for a transparent HUD, or an image/chroma background for capture in OBS. Select the display for the page.
- Bind indicators to the physical inputs, vJoy controls, or states you want to display.
- Enable the page's Interactive option if it should accept input, then use Show overlay to open the live panel. Writable vJoy and ordinary-state bindings can be operated from the live window.
- Start the profile to test any mappings triggered by those controls. Use Map to Overlay to show or hide pages, groups, and widgets, change interactivity, or update variables from an input.
For a phone or tablet panel, choose the page's Websocket mode. Set its Port, or use Suggest free port, then show the page. Copy the displayed LAN URL with Copy URL and open it in a browser on the same LAN. Enable Interactive for touch controls to write to their bindings. Use that displayed URL, which includes the selected port, rather than constructing one manually.
An OCR widget can capture a selected screen region and match text against rules. Map the rule's virtual-button input to actions when recognized text should trigger a command or update a state. Configure and test the capture region and matching rules before adding the final output.
See the Overlay guide for page design, interactive controls, OCR, and OBS capture.
Show a remote computer in an overlay¶
Use an overlay Remote View widget to display a screen or application captured by another GremlinEx machine.
- Configure remote control on both machines so the master can discover the client.
- On the client, open the Remote Control options. Under Video return to master, enable Send video feed back to master.
- Choose Entire screen or Application window as the source, then select the screen or application. Adjust Max width, FPS, Quality, and Encoder for the connection and available resources.
- Start a profile on the client. Video publishing runs while that profile is active and stops when it is deactivated. Allow the configured Video port through the client's firewall if needed; the default is TCP
6013. - On the master, add a Remote View widget to an overlay page and select Remote client in its inspector. Use Refresh clients if the client is missing, then show the overlay page.
Use the KVM action and the current local/remote routing settings when you also need to forward keyboard and mouse input to that client.
Voice recognition device¶
The Voice module uses local speech recognition to turn phrases into mapped inputs. Its recognition model is downloaded when needed; allow that first download to complete before testing commands.
- Enable Voice in Options → Modules and open the Voice device.
- Open the voice configuration controls and select the microphone and recognition model. Use Monitor Input and the audio meter to check the microphone level.
- Choose an activation mode: Always On, Toggle, Press to Listen, or Press to Suspend. Configure the controlling input for a mode that needs one. Off disables recognition.
- Add a voice input. Enter a phrase in Voice Command(s); separate alternative phrases with
|, such asgear down|lower gear. Recognition ignores case and punctuation when matching commands. - Add a container and action to that input, save, and start the profile. Enable listening according to the selected activation mode, speak the phrase, and observe the output.
Use the optional recognition and activation audio cues to hear when listening is enabled or a command matches. The Control action can enable, disable, or toggle voice recognition from another mapped input. Choose a smaller model first if recognition uses too many resources, then compare accuracy with your microphone and commands.
AFCS axis flow designer¶
Enable AFCS in Options → Modules to build axis-processing graphs in the AFCS tab. Use named inputs and processing nodes to combine axes, apply curves, and send the result to an output.
- Create a graph input with a meaningful name, such as
left_brake. - Select the physical axis and add Map to AFCS. Set AFCS input name to the graph input's name.
- Repeat for any additional source axes.
- Connect the input nodes through the desired merge or curve nodes to a configured vJoy output node.
- Save and start the profile. Move each source separately and then together, checking the final output in the input viewer.
Check that the AFCS output destination does not also receive a conflicting direct mapping. For a simpler two-axis merge, use the merge controls in Map to vJoy.
Reordering of devices¶
Microsoft Windows does not currently offer a way to set the order of devices connected to a computer, and furthermore, this order may change depending on connections/disconnections, reboot status, and the order of detection by the operating system. To this end, GremlinEx offers a way to manually re-order devices as displayed in GremlinEx for convenience via drag and drop of the device tabs. The order only exists within GremlinEx and it does not change the device order in the operating system.
The default order is joysticks and gamepads, enabled virtual inputs, special devices, then Settings and Plugins. New devices join their default group. User reordering is preserved, including the positions of Settings and Plugins. These two tabs are always visible and cannot be filtered out. Default in Order Devices restores the default order.
Save, Load, and Load Last in Order Devices save or restore device visibility only. Loading a visibility layout or changing visibility checkboxes does not change the tab order. Dragging device rows explicitly changes the order.
Inputs¶
An input is a source trigger definition. When you press a button on a controller, move an axis, or press a key or click a mouse button, all these are input source triggers that can be mapped to a series of actions.
Some hardware devices have a fixed set of inputs defined at the hardware (firmware) level. Some controllers can change that information with their own programming, but for the purpose of GremlinEx, physical hardware defines a fixed number of axes, buttons and hats it can use for mapping.
Examples of physical inputs¶
Inputs can be a button on a joystick, and axis or slider on a joystick, a pressed key on the keyboard.
Examples of virtual inputs¶
A virtual input does not come from a physical device. It typically comes from receiving a network message (such as OSC or MIDI), or from a software virtual device like VJOY used as input. Virtual devices are not "real", but they function nontheless the same way as physical inputs do.
Virtual inputs have to be configured in GremlinEx, so you need to tell GremlinEx what to listen for. For example, which OSC message to listen to, and what should the message parameters be.
Another input may be a complex key combination to trigger on, such as left-control, left-shift, A and CAPS-LOCK pressed concurrently. Unlike the "traditional" keyboard combinations, GremlinEx can latch multiple keyboard inputs together and require all of them to be pressed concurrently to trigger, so quad key combinations and up are completely feasible (although perhaps not practical).
Input Widget¶
The input widget corresponds to an input for the device currently selected. For controllers, GremlinEx displays "live" inputs (when the option is enabled, which it is by default). The repeaters will show the current axis or button state for controllers.
Input widgets will show an icon for each action map found in the containers attached to the input for a quick visual review of all actions mapped to the input.
Input widgets will also have a calibration button to calibrate the input axis (global), or for setting up a curve for the input.
If the input can be configured, for example, OSC or Keyboard devices, a configuration button is also visible.
In the example below, two keystrokes are defined as input. Alt-C and F5. While Alt-C is not selected, the icon in the input widget indicates it is mapped to button #1. The input box for F5 shows that it has two actions, button #1 and another joystick action.
Because the action is complex, it won't show the details but from the action configuration we can see it's setup to toggle button #2 whenever the F5 key is pressed, and to pulse button #1.
The bottom of the input panel has two buttons, one to add a new input, one to remove it. These buttons are only displayed on inputs that are configurable, such as the Keyboard, OSC, or MIDI devices.
Special Mode inputs¶
The Mode device is a special device that defines two fixed inputs. These are triggered whenever a mode is activated, or deactivated.
In the example below, whenever the "Default" mode is activated, the F18 key will be sent.
Automatic input selection¶
Depending on the number of axes and buttons a particular device has, it's not always clear which axis or button it is. To this end, GremlinEx has a feature to automatically select the input when you move an axis or press a button. This works for controllers only (so not for keyboard or mouse inputs).
There are four options:
- Disabled: automatic highlighting is turned off.
- Button: automatic highlighting switches to the pressed button.
- Axis: automatic highlighting switches to the moved axis.
- Device: automatic highlighting switches the device.
These options are also available in the Gremlin options panel.
It it not advised to have the axis or device modes enabled if you have a noisy input as the UI will constantly thrash because it will detect constant inputs.
Conditions¶
GremlinEx can apply conditions to triggers to modify what should happen when an input trigger happens.
Conditions can be used to:
- only trigger a mapping if another condition is true (or false), such as an key or button is pressed, released, or another axis is within a certain range.
- trigger on release only
- turn on or off certain activations at the container level or the individual action level.
Conditions apply to containers or actions or both concurrently.
Conditions are cummulative and apply in the order of evaluation, so conditions on containers are evaluated before conditions on actions.
List of currently supported conditions:¶
| Condition | Description |
|---|---|
| Virtual Condition | Checks the axis, button, or hat state of a GEX Maestro or vJoy device. Saved vJoy conditions use the active Maestro device when failover is enabled and a replacement is available. |
| Joystick condition | This condition checks for a joystick or controller input state, such as an axis in a given range, hat or button pressed or released. |
| Keyboard (mouse) condition | This condition checks for keyboard and mouse states. |
| State condition | This condition checks for a state value. |
| Mode condition | This condition checks for a particular profile mode being active (or inactive). |
Virtual Button¶
When mapping a momentary action to an axis, the virtual button tab usually becomes availble to define a range on the axis where the condition is active. In the example below, the action is enabled when the input axis is between -0.0965 and +0.324.
Condition tab¶
The condition tab on a container (appears below the action tab) is used to configure conditions on the container for its activation. Conditions are cummulative.
Container conditions¶
Container conditions apply to the whole container. In the example below, button 27 on the HOTAS Warthog device must be pressed for the condition to pass on all actions in the container.
Action conditions¶
Action conditions only apply to a specific condition. In this case, the play sound action will only be active if the F4 key is pressed. Because the play action is also subject to the container condition, both conditions must be true for the sound to play. Because the container is mapped to an axis, and a virtual button is defined, not only do the action and container conditions be true, the axis must also be in the correct range.
Automatic Input detection¶
GremlinEx can usually detect at edit time and auto-highlight hardware joystick input devices by clicking a button or moving an axis on them. This eliminates the guesswork on how the hardware maps to buttons or axes, and what the state of the input is.
Automatic detection is only active when a profile is not running.
When in this mode, GremlinEx will attempt to display the correct input - I say attempt because it can get confused sometimes with multiple active concurrent inputs.
The default behavior is it waits for an axis or a button to be activated before displaying anything, so the initial load up UI may not reflect the input until it's touched again.
GremlinEx has a built in protection against multiple inputs, but will display the last detected input if multiple inputs were sent.
There are three options that control this behavior in the GremlinEx options panel:
| Option | Description |
|---|---|
| Highlight currently used input (axis + button) | Will switch focus to the input device for axis or button changes - this can make it difficult to just pick a button |
| Highlight currently used buttons | Detects button changes only (axis movement is ignored but can be overriden - see below (this is recommended) |
| Highlight swaps device tabs | Changes input tabs automatically (this is a recommended) |
As of 13.40.14ex, GremlinEx also has an option to display input repeaters as well for all joystick hardware inputs showing live axis position as well as button state.
As of 13.40.16ex, GremlinEx has an input options bar at the bottom right of the main window to easily toggle highlighting options without going to the options dialog or using the hotkeys.
Button detect only overrides¶
A pair of modifiers can be used to modify how input is detected.
| Option | Description |
|---|---|
| Left shift | If you hold the left shift key, GremlinEx will track axes instead of just buttons regardless of the options selected . |
| Left control | If you hold the left control key, GremlinEx will only track axes regardless of the options selected . |
Recommend that you set the default behavior is to track buttons only as it's very easy to trigger an axis by pressing a button because many hardware devices are very sensitive. Use the left shift or control key to modify that behavior on the fly.
Note that whatever is first detected will go to that item (axis or button) if nothing is selected. This is on purpose to pick a starting point.
Holding the left-shift key down when in button detect mode temporarily enables axis detection as well as button detection. This is the same as the first option in the table above.
Holding the left-shift key and the left-control key when in button detect mode temporarily enables exclusive axis detection and ignores button presses. This is helpful when you have a hardware axis that also has detents along the way that send button inputs. In this mode, these buttons will be ignored.
Remote control¶
For the walkthrough, see GremlinEx remote control setup.
GremlinEx can link multiple GremlinEx instances running on separate computers on the local network. One instance (the broadcaster) can remote control another GremlinEx (client) as well as output to itself. This is helpful to share a single set of controls or profile on a master machine to one or more client machines on the local network.
As of T183, GremlinEx, actions that support remote output can control specific GremlinEx instances on the network, or any (all).
| Supported output mode | Description |
|---|---|
| Local (default) | The profile output sends controls to the local machine. This is the default mode and is the primary way to use GremlinEx. In this mode, the profile output sends joystick, keyboard and mouse data to the local machine only. |
| Remote (any) | The profile output sends controls to all GremlinEx instances running on machines attached to the local network. This mode was the only "remote control mode" prior to T183. All clients receive the control data. As of T183, the "any" client must be selected to send to all remote clients at once. This is the default remote starting configuration for T183 to maintain compatibility with older profiles. |
| Remote (specific) | The profile sends controls to specific clients. This mode is only available after T183. Only the selected clients receive the control data. |
| Combined | Local and remote modes can be combined together. In this mode, the control data is processed by the local instance, and any selected clients or all of them depending on the remote mode selected. |
| KVM mode | The KVM action routes keyboard and mouse input according to the current remote control mode while its input is held. Local mode keeps input on the local machine, remote mode forwards input to the selected clients and suppresses local input, and combined mode allows local and remote input concurrently. Mode changes take effect while the action is active. Joystick and OSC/MIDI inputs continue to function in KVM mode. |
GremlinEx offers actions to enable/disable remote control at runtime so remote control can be enabled or disabled as needed while a profile is running. This can be toggled from any button input like a joystick button, an OSC command or a keyboard input. A best practice is to attach the remote control mode to a physical switch on a hardware panel to enable or disable remote control of other GremlinEx clients as needed.
Clients automatically register with each other when started if they are setup for remote control in the global options.
Clients can only be remote controlled if they are running an active (blank) profile.
| Requirements for remote control | Description |
|---|---|
| Local network connection | The instance must run on a computer connected to the local network only. Instances connected via VPN or across a router will not work which is a security design feature. |
| Similar version | The instance must run a similar version to the broadcast machine or connections may not work as intended because the older client may not understand the data it receives. |
| Firewall port open | The local firewall on each computer must allow GremlinEx to communicate over the UDP port (6012 is the default). This normally happens automatically the first time GremlinEx runs and attempts to open a connection. Some Windows installation may not allow this automatic firewall registration depending on the local security policies and User Access Controls (UAC) settings. In this event, the firewall must be manually configured. |
| Profile running | Remote control is only enabled if a profile is running on each client. The broadcast machine must run a profile and be in broadcast mode (profile controlled), and each client must have remote control enabled in the options, and run a profile. For clients, a blank profile is ok to run and this is the recommended configuration. |
| Specific client remote control | The client must be selected on the broadcast system as a target client. If the client does not show on the available list, it is not communicating. This means it is the wrong version, is not allowed to communicate (blocked by network security or UAC or is on a differnet subnet or VPN), or some other issue that can usually be resolved via a restart of both the client and the broadcast machine. |
| GremlinEx instances must use the same port | Check the port number is the same for all GremlinEx machines. |
| Multicast must be enabled. | This is the default for all Windows machines, however some network configurations may block multicast from working. GremlinEx requires multicast to be enabled. Enabling multicast is outside of the scope of this documentation. It is enabled by default in Windows and used by many services so there is no reason it should be off, unless it was turned off or forced off. |
| Supported remote control events | Description |
|---|---|
| VJOY output | The remote clients understand VJOY output including axis, button and hats. The local VJOY configuration must match the data received, so should match the configuration of the broadcast machine and profile being used. It's okay for a client to have fewer VJOY devices than the broadcast machine, however the axis, hat and button count should be the same. |
| Keyboard output | The remote clients accepts keyboard output sent via the Map to Keyboard/Mouse Ex action. Use this for mouse button/wheel output as well. |
| Mouse output | The remote clients accepts mouse output including motion sent via the Map to Mouse Ex action. Use the Map to Keyboard/Mouse Ex action for button/wheel output. |
| KVM mode | The KVM action forwards keyboard and mouse input to the selected clients when remote output is enabled. Local input remains enabled in combined mode and is suppressed in remote-only mode. OSC, MIDI, Joystick and State inputs continue to be processed normally. |
| Not supported for remote control | Description |
|---|---|
| OSC and MIDI | Local clients must handle this directly, or via the broadcast machine to map these input types to VJOY, keyboard or mouse outputs that are processed on the remote client. |
| Mismatched VJOY configuration | Local clients must have matching VJOY device, axis, button and hat setup to accept data that outputs to these specific devices. The best practice is to setup VJOY on the remote client exactly the same way as the broadcast machine to avoid issues. |
| Clients not on the local network | Clients that are on different subnets or VPN will typically be unable to communicate with the broadcast machine due to designed security measures. |
| Clients running an older version | Clients ideally will run the same version as the broadcast machine to understand the data it receives. |
| Common issues with remote control | Description |
|---|---|
| Client is not visible to the broadcast machine | This indicates there is no communication between the client and the broadcast machine. See above for requirements. A restart of both broadcast and remote client can help if the issue is not security related, or after making necessary changes to the network configuration. |
| Client doesn't do anything. | Check that the remote control option is enabled in global options, that the ports match. The broadcase machine should show the client in the list of clients when connected and use the "any" mode or the specific client. The client may also have timed out. A restart usually resolves the issue. |
Client Configuration Options¶
Remote control options are setup in the global options in GremlinEx. The normal setup is only one client is designated as the broadcast server. The broadcast client will send data to other clients. Technically, multiple clients and broadcast to other clients as well, so it is possble to have more than one broadcast client, hence why usually the broadcast server can also be remote controlled by other clients.
Action Output Configuration¶
The following actions can be configured for output:
| Action | Description |
|---|---|
| Vjoy Remap | Send VJOY events (axis, button, hat) to remote clients. |
| Map to Keyboard/Mouse Ex | Send keyboard and mouse button/wheel events to clients. |
| Map to Mouse Ex | Send mouse button and motion events to clients. For buttons and wheel, it is preferrable to use the Map to Keyboard/Mouse Ex action instead. |
| KVM | Routes keyboard and mouse input (including motion) using the current local/remote output settings. Combined mode keeps local input active while forwarding to clients; remote-only mode suppresses local input. Joystick, OSC, MIDI and State actions continue to execute normally. |
By output events, we mean that inputs into GremlinEx are not broadcast to clients, only events that GremlinEx outputs are synchronized with clients.
Not all actions support remote control. The current actions that do are
- Vjoy Remap
- Map to Keyboard/Mouse Ex
- Map to Mouse Ex
- KVM
Important security considerations¶
GremlinEx ensures security by:
- using non-routable UDP traffic (the data will not cross routers).
- clients must be on the local network
- clients must have remote control enabled in the configuration.
- clients must have a blank, running profile to be remotely controlled.
- the firewall must allow the configured port.
This said, GremlinEx is not designed to handle sensitive data given its purpose as a gaming hardware integrator.
Do not use GremlinEx to transmit secure or PII data as transmitted data is not encrypted (by design for speed) as the scope of GremlinEx is game control
Master machine setup¶
The master machine is the machine responsible for broadcasting control events to clients on the local network. Thus it will typically be the primary system with all the physical hardware managed by GremlinEx.
The broadcast machine or master system will have the broadcast option enabled and an available UDP port setup (default 6012). When the broadcast feature is enabled, GremlinEx will broadcast all output events.
Important: to broadcast, the option must be enabled in the checkbox, and the GremlinEx profile must also have enabled the broadcast functionality on. This is needed because when GremlinEx first starts, it defauts to local control only.
Profile commands can be mapped via the VjoyRemap plugin to control whether GemlinEx sends outputs to the local (internal) or clients, or both concurrently.
While more than one master machine can broadcast, it's recommended to only have one. Multiple machines will allow more than one machine to send broadcast commands to clients for unique setup needs.
The enable speech checkbox can be selected for GremlinEx to send a verbal mode change event whenever local/remote mode control is changed in case the GremlinEx window is not visible.
| Option | Description |
|---|---|
| Enable control of this client by a remote server | Enables this client to receive commands / input from another GremlinEx instance on the network. |
| Enable server broadcast | Enables this client to send (broadcast) commands / input to other GremlinEx instances on the network. |
| Host name | name of the current client (this can only be changed by the operating system) |
| Custom client name | Custom name used by GremlinEx if the host name is not used. This is also known as the friendly client name. |
| All IPs | Controls which IPs are used. Default is on to support multicast. This is not used in normal circumstances. |
| Broadcast server IP | Leave automatic. This is for multi-homed machines (machines with more than one active IP address). If you have multiple active network connections, specify which one to use here. |
| Master | Leave this on. This is from a legacy setup. |
| Broadcast port | This is the commmunication port to use between all GremlinEx instances. All GremlinEx instances should use the same port. 6012 is the default. |
Remote control status indicators¶
In this mode, GremlinEx sends VJOY, keyboard and mouse events to clients on the network. The clients must have the remote control checkbox enabled, match the port number, and have a profile running (empty profile is fine) to respond to the broadcast events.
GremlinEx's main window displays the remote control current status in the lower left of the UI:
| Indicator | Description |
|---|---|
| Broadcast mode | Indicates if the instance is able to send to remote instances on the network. This is set in global options under the Enable Server Broadcast. GEX may need to be restarted after this change in some situations. |
| Remote control mode | Indicates if the instance is currently able to be controlled by another network instance. This is set in global options with "Enable remote control". |
| Profile remote mode | Indicates the profile was set to remote mode by a control action at runtime. This acts on actions configured to send output to remote instances, like vjoy remap and map to keyboard/mouse Ex, and toggles between local output and remote output if the option is selected in the action. This mode is enabled or disabled via the control action and is meant to easily toggle between local mode and remote mode without having separate mappings for each. |
Action remote control configuration¶
Certain actions support output to remote instances (clients) on the network. The following options can be set to configure this behavior:
GremlinEx can send to the local and remote clients at the same time by selecting in the actions that support remote control local and remote modes. When remote is enabled in the action, the
Override mode¶
As of T176, the Vjoy Remap and Map to Keyboard/Mouse Ex actions have the ability to override the current remote control context and map outputs that only go to the local client, the remote client, or both. In the default mode, the action follows the current profile remote control state. These actions have a drop down selection box that lets you select the desired remote control options for that action only.
The override mode is meant to simplify some mapping tasks independently of the global profile setting.
Client machine setup¶
Each GremlinEx client needs to have the remote control option enabled in options to be able to receive events from the master machine. The master machine must also be setup to broadcast these events.
The client must be in run mode to accept broadcast events, and the profile can be empty. No profile needs to be loaded on the client when the client is in remote control mode.
Clients will only output to VJOY outputs that match the master. So if the client has the same setup for VJOY (number of VJOY devices, button counts and hat counts) as the master machine, all VJOY events will be synchronized with the master machine. This is the recommended setup.
Clients will ignore events for devices that do not exist on the client (such as an invalid VJOY device number, or an invalid button for that defined device).
GremlinEx options setup for a client:
The enable remote control checkbox is checked, and the port (default 6012) must match the broadcast machine's port.
By default, actions only output to the local machine. Actions that support remote output support output to any (all) client, one or more selected clients, or the local machine. Note that when sending data remotely, the local client is excluded. To send both remotely and locally, local and remote mode must be selected. It is not possible to select the local client as a remote client from the local machine.
Important: the GremlinEx client controlling other clients must be in broadcast mode. Other clients being remote controlled must have remote control enabled in options, and must also have a blank profile running.
Profile mapping¶
GremlinEx has multiple options to automate the loading and activation of profiles based on what process has the current focus (meaning, the active window).
Automatic activation¶
If a process (.exe) is mapped to a specific profile (.xml), GremlinEx can automatically load this profile when the process has the focus at runtime. This only works when a GremlinEx is in "run" mode - so a profile was loaded and activated.
If configured, GremlinEx will load the mapped profile corresponding to the process (.exe) automatically in the background. Depending on the complexity of the profile, GremlinEx may take a few seconds to become active as it loads the process and activates it.
The automatic load occurs whenever GremlinEx detects a process focus change.
Keep profile active when focus is lost¶
This mode is used to ensure GremlinEx keeps the profile running even if the process it is mapped to no longer has the primary focus. This happens, for example when you alt-tab, or when you activate another window. The recommendation is to leave this option enabled.
Profile start and stop event mappings¶
Starting with m76T40, it is possible in the Mode/Profile device tab to define actions that will execute either on profile start, along with actions to trigger on profile stop. These will execute on every profile start or stop and can be used to initialize outputs.
For example, it is possible to send an OSC command to OSC based control panels on the network or the local machine to call up a particular configuration.
Actions mapped to profile start and stop will behave as a joystick button with a press and release. The delay between press and release is defined in options as the default auto-release delay, and defaults to 250 milliseconds.
Mode selection¶
When automatic profile load is enabled, GremlinEx has the option to override the default "startup" mode of a profile. This is by default, the top level mode. There are two options of interest:
- Activate a default mode when the profile is activated (this is the normal mode)
- Activate the last mode used when the profile was last activated (this is the alternate mode). If this is enabled, the default mode setting is ignored. The first mode used will be the default mode if the mode has not been changed before.
In addition to this, the profile itself provides actions that can switch modes.
Mode change event mappings¶
The Mode/Profile device tab lets you define actions to occur when a mode is entered or exited. This includes when the default mode is activated on profile start.
There is one set of mappings possible for each defined mode.
Actions mapped to mode start and stop will behave as a joystick button with a press and release. The delay between press and release is defined in options as the default auto-release delay, and defaults to 250 milliseconds.
Note: if you delete a mode, any associated mappings linked to mode enter/exit will be deleted.
Profile device substitution and input order¶
Windows is notorious for changing the order of gaming controllers and to this end, GremlinEx does not use the sequence of controllers. GremlinEx tracks input controllers by their hardware ID, a "guid" or globally unique identifier that includes the manufacturer hardware code, and unique to a device. This approach avoids the device re-order issue, but walks right into, what happens when the hardware ID changes?
The hardware ID is saved with a profile, and mappings are tied to that hardware ID.
On occasion, hardware IDs for HID devices can change as reported by Windows. This can happen when:
- the input is programmable and lets you change the hardware ID (example, Arduino, Rasberry Pi custom hardware controllers)
- the manufacturer provides a firmware update changing the input ID
- the input is wireless and the ID resets on device reconnect
- two inputs have the same ID (example, plugging in two identical joysticks), and the hardware driver assigns a new ID - which is usually a sequence.
Substitution¶
To help with situations where the hardware ID must be changed, while it's always possible to manually edit the profile XML with a text editor such as Notepad++, GremlinEx as of 13.40.14ex includes a small substitution dialog that lets you swap out device IDs. This is accessible by right-clicking on a device tab and selecting device substitutions, or from the tools menu.
Caveats with profile automation¶
GremlinEx only has information about which process has the focus from the operating system, and the configuration options. As such, it is completely possible that you will experience conflicts if you have programmed these in, or constant loading/reloading, frequently changing process and otherwise attempting to break the detection logic. One reason for this is large profiles take a while to load and if the target process is changed while a load is in motion, it may trigger a delay and GremlinEx may not immediately respond to changes
Recommended configurations to avoid:
-
have two (or more) processes running concurrently with each associated with an automatic load profile and constantly changing focus between them rapidly. This will cause a profile reload/reset and new mode activation whenever the focus changes. Some optimizations were made to the profile load - caching is planned for a future release to avoid load delays.
-
attach a profile to a non-game process, such as a background process.
The recommended approach is to only execute one mapped process at a time, and to ensure the profile remains active when the process loses focus, such as when alt-tab or switch to another window on multi-monitor setups. Automatic profile loading is also not recommended while you are designing a profile. Only automate profiles that are not being actively edited/modified to avoid Gremlin activating the profile while you are editing it.
Caveats with loading to the prior mode¶
Loading the prior mode may not necessarily be expected, as it will vary with the last known used mode. This can be confusing and unexpected, but it can be helped by ensuring that you tell GremlinEx to say what mode it's in whenever a profile starts.
Copy/Paste operations¶
Starting with GremlinEx 13.40.13ex, copy/paste operations are supported on actions and containers.
To copy an action or container, click the copy button in the title bar.
To paste and action or container, click on the paste button next to the add action or add container.
Pasting is not possible if the container or action is not permitted for the type of input being mapped.
You can persist a copy operation between GremlinEx sessions by checking the option in the options dialog. This will save the data to the profile folder, and it will be available at the next session.
If the persist option is not checked, GremlinEx will use whatever data is in the Windows clipboard from the last copy operation in GremlinEx.
Devices¶
HID devices¶
GremlinEx will show all detected game controllers in tabs located at the top of the UI. These are the raw input devices, either buttons, hats or axes.
Device change detection¶
(New as of 13.40.14ex as of m22)
GremlinEx will detect a connect/disconnect of direct input devices (devices the DirectInput API monitors).
A device connect/disconnect by default forces a profile restart, unless the "ignore device change at runtime" option is selected (enabled by default).
If the option is enabled, a device change will be ignored if a profile is active to avoid distrupting the profile. Disconnected devices will no longer provide input. In this mode, if the device reconnects, the reconnect will also be ignored except that GremlinEx will start processing the direct input events again, so long as the device previously disconnected is the same (and has the same hardware ID) of the reconnected device. This feature is designed to help with devices that go to sleep (disconnect) and then wake up (reconnect). If a device change is detected while a profile is running, the UI will only update/refresh with the new device when the profile stops. A profile change at runtime (based on options) will load the detected device list at the time it was loaded. This also means, since changes are ignored, that if a device is not visible at the time the profile loads, the device will never be visible while the profile is running in this mode. Devices must be visible at profile start to be enabled. If they connect later, they will not be usable.
If the option is disabled, a device change will force a profile stop (or restart depending of options). This is typically not the desired behavior but is provided as an option.
When a profile is not running, the UI will always update when a device change is detected and the device tabs will update.
Avoiding device detection and sleep issues¶
Make sure all devices are awake and visible at profile start¶
The best practice to avoid device issues is to make sure that all the devices you intend to use in a profile are all awake and connected (thus detectable) before the profile starts.
Sleeping devices after startup¶
While it's okay for a device to disconnect/sleep and then reconnect/wake up if it has been previously detected at startup time, and the "ignore device change at runtime" option is enabled.
Undetected devices may not be available after startup¶
A device that is not detected when a profile starts will typically not be usable unless the profile is reloaded, so ensure the devices are visible and active at startup time.
Runtime device changes create a dragon rich environment¶
In general it is not recommended for devices to change while a profile or game is running as that tends to create a dragon rich environment that is best avoided whenever possible.
There are always going to be a edge cases because all hardware and configurations are different. GremlinEx will do its best to handle dynamic changes but there is only so much safeguarding and edge case handling that is a reasonable expectation.
Joystick (axis) device¶
GremlinEx can map detected joystick devices to actions. New with 13.40.15ex is the ability to apply a response curve the input directly before the value is processed by a mapping action.
If no curve is provided, the input is used as is, matching the behavior of prior releases for GremlinEx.
If a curve is provided, the input value will be modified based on the provided curve before being sent to a mapping action.
Curves are mode specific so each mode can have its own input response curve.
The curve button is used to add, or edit an existing curve. It will show blue if a curve is already defined.
The delete curve button is used to remove a curve. A confirmation box will be displayed.
Axis Calibration¶
The purpose of calibration is to filter or re-scale input data before it is further processed by GremlinEx by curves or action. The available filters enable you to:
- Tell GremlinEx if the axis has a center detent or not. Center detents means the input axis usually is held at a center position in normal use. This is different from a slider axis which is typically only linear and has a minimum/maximum only.
- Tell GremlinEx if the input should be inverted (reversed). This feature flips the direction of travel and is hardware dependent. Note that if you need to invert an axis only for a specific profile specific, use the inversion setting with a curve input or response curve setting, or at the action level in Map to Vjoy as the inversion setting in the calibration dialog is global, thus applies to all profiles.
- If you have a noisy (usually potentiometer based) input, ability to set input deadzones. Deadzone identify areas of flutter, or noisy input, where the input sends data even if it's not moving, or sends a range of data that varies at the extremity of travel or while in the center position. Inputs that use optical or hall effect sensors to detect motion usually do not need this.
- Invert the input which is part of calibration. Inverted data just reverses the input before downstream actions are executed so this can be seen as a "global" setting for the axis.
Starting with GremlinEx 13.40.16, calibration is done individually for each input axis as needed.
Starting with GEX m76T121, calibration data can be saved on a per profile basis, or global, or both. The way this works is if calibration data is saved on a profile, it will be used instead of any global calibration.
The calibration button shows in the input axis toolbar for axis devices only as indicated below.
The calibration button brings up a dialog to setup calibration for that specific input, which will be listed at the top of the dialog.
When you exit the dialog, the settings are automatically saved and applied. Internally, GremlinEx saves the calibration data to an XML file located in the user profile folder.
If you had a prior calibration profile setup for an input, GremlinEx will attempt to load that data into the dialog, however you should always check the data as imported and to set other options as well.
If GremlinEx detects calibration data for an input that is different from the default (unfiltered) state, the button will be blue indicating a filter is being applied.
Global scope¶
Any calibration options apply to the input globally across all profiles. GremlinEx provides alternative ways, at the profile level, to setup deadzones and inversion and response curve that are profile specific. The global calibration makes particular sense with noisy inputs so that can be setup once for each hardware input without having to repeat the configuration for each profile.
Understanding the processing order is important to diagnose unexpected behaviors, or to craft the profile in a way to achieve the desired behavior.
The GremlinEx processing order is listed here in the order of execution:
- Global scope
- Raw input (as provided via the DirectX layer)
- Calibration (if any)
- Profile scope
- Input curve (if any)
- Containers (most are pass-through)
- Actions
- Curved response
- Individual actions
- Output
- Actions
Each stage of processing is optional and only applies if present/setup. Understanding the order of processing is important.
Every stage of processing applies to the steps below it. So an inversion setting in calibration will apply to all downstream processing steps, but an inversion setting in an action will only apply to that action and will be stored as a profile setting.
Range and accuracy¶
The range of all inputs is normalized -1.0 to +1.0 throughout GremlinEx regardless of the hardware's input range.
The DirectX standard provides 65,536 values (16 bit) for any input, which are normalized to -1.0 to +1.0.
Internally GremlinEx use floating point numbers that far exceed the 16 bit resolution, although it will display three decimal points by default which is usually sufficient for simulation, game or music purposes. The displayed value is lower resolution than the internal value so no data loss will be experienced.
Live feedback¶
As you setup calibration data and change options, the changes you make will be reflected live when you move the input so you can instantly see the impact of your calibration to make sure it provides the expected behavior.
The output visualization is below the main calibration bar, and a numeric value repeater is also provided for the exact numerical value computed by the calibration logic.
Centering¶
By default, all inputs are considered centered. GremlinEx does not know if the input is centered or not, so you need to tell it. This is because hardware comes with different capabilities and the notion of "centered" is really up to you. It is true that some hardware does report the type, however in my experience, it's up to you to determine how you want to use that input, as it is context specific. You can have a centered slider if that is what you need for your particular context, and you can remove the center position from a centered input if that is your use-case.
Inversion¶
The inversion setting is a global setting that inverts the input. This is helpful in some scenarios and is really hardware and context dependent. For example you may have a control panel that you have mounted upside down, or the hardware naturally reports feedback inverted and you need it to always be reversed. Inversion does not scale input, it only flips the direction of travel.
Calibration limits¶
The two extremities, left and right in the dialog, determine the maximum (minimum) absolute travel direction of the input axis. This primarily applies to potentiometer based input axis that may report a range of different values when the input travels to its stops. The calibrate button resets the left and right nodes to the center position and you can then move the input to its maxium and minimum position to set the limits automatically. All inputs in GremlinEx are normalized to -1.0 to 1.0 so the limits will appear as a floating point value.
If you have an input that is inconsistent, set the limit to a value that will filter out this inconsistency so you end up with a reliable signal.
You do not need to press the calibrate button to set the limits, they will always move to the minimum/maximum but they will not move "back", meaning that if the values change, it will take the smaller value (minimum side) or larger value (maximum side) so the calibration button just resets the values to 0.0 for convenience.
The minimum and maximum can be set manually via the input boxes.
Once set, the calibration minimum/maximum will scale the input value to -1.0 and +1.0 based on what you have set. The calibrated value that is computed will be displayed in the output repeater below the calibration bar, and also in the calibrated value repeater for the numeric value output.
Calibration center¶
This only applies to centered axis input. The option will not be visible if the axis is not setup as centered.
The calibration center is provided to set the middle point in the input range that corresponds to the normal center position of the input. For some devices, this is not necessarily the midpoint value, which is why this is provided in case the hardware is offset. This happens mostly with non optical or magnetic (hall effect) sensors.
In most cases, this center calibration value should be 0.0, the midpoint between -1.0 and +1.0.
As with the rest of the calibration dialog, the setting is global and will apply to all profiles
You can set the value by pressing the Set Center button while the physical input is in the center position. It doesn't have to be exact as usually if you need to change the center position, you also need to provide a center deadzone range as it's unlikely the input will always return to that exact position if you need an offset in the first place.
As with the range calibration, you can also manually set this value in the input box.
Reset¶
The reset button resets calibration values to default as a convenience. It will not reset deadzones or the centering setting.
Deadzones¶
Deadzones setup in the calibration window are global, and apply to all profiles regardless of any other deadzones setup down the line via curves or mapped actions.
GremlinEx currently provides three (3) deadzones. There is one for each extremity of travel. The third is for centered inputs (it has no meaning if the input is not centered, or continuous).
The purpose of the deadzone is to filter out noisy input towards the extremities or the center. While the input is in the range specified by the deadzone, it will always report a single value, -1, 0, or +1, for minimum, center and maximum.
The bottom of the dialog is used to define the deadzones.
The values can be set by dragging the knobs or setting an input value.
If the input is centered, the deadzone for the center will not be displayed in the dialog.
The center deadzone has two values, for the low end of the center and the high end of the center.
Extremities only have one value.
The live repeater will instantly display the impact of the applied deadzone so you can visualize the value and tweak the deadzone as desired without having to run a profile.
Calibration Tips¶
Calibration is global, so lets you define setting that apply to all profiles at once. The main one there will probably be the inversion setting.
Calibration and deadzones usually only apply to devices that tend to have noisy inputs, but you can also use the calibration data to "scale" the input globally.
For example, by shifting the center point to an offset, you can scale the response of an input's lower and upper half easily. A use case for this may be a throttle input for a space game, or for reversers: You may want a more sensitive upper range value than you want for the lower range so you have more forward resolution than you do going back.
You can also match the center position to the physical detent position of your input if it has one, as those may not be the exact center as the input reports.
Curve Editor¶
The curve editor dialog is used to add or edit a curve when applied to an input, the VJoy Remap action, or the standalone Response Curve Ex action. The legacy curve mapper does not use this new editor to maintain compatibility with earlier profiles.
Remember to save the profile after closing the dialog to preserve the data into a profile.
As with other data items in GremlinEx, curves are applied to a specific mode, so each mode can have its own set of response curves, or no response curves.
Curve types¶
GremlinEx supports two types of curves. The cubic spline curve is a typical cubic response curve, and the bezier curve is similar but uses control handles to determine the shape of the curve going through each control point.
Coordinate system¶
A curve in GremlinEx takes the input along the X axis, and converts it to the output along the Y axis.
The coordinate space is -1.0 to +1.0 in both X and Y, which matches the GremlinEx axis range, and the VJOY axis range. Note that this range is different from the DirectInput range. All actions and plugins will use the -1.0 to +1.0 range if the input is an axis regardless of type.
The center of the graph corresponds to 0,0.
Control Points¶
A curve must have at least two control points for input positions -1.0 and +1.0. These points cannot be removed. However their Y value can be changed.
You can add a control point by double clicking anywhere on the curve.
You can move a control point by selecting it with the mouse, or with the control point selector buttons. The control point will be shown in red.
and left-dragging it with the mouse, or by changing the selected control point's coordinates in the input boxes for very precise positioning. The coordinates can also be changed when the mouse hovers over the input using the wheel, and if shift is held while the wheel is moved, this toggles between coarse/fine modes.
A control point can be deleted by selecting it, then clicking the delete button. Again the points at -1.0 and +1.0 in X (input) cannot be deleted.
In general you should use the least number of control points that yield the desired result.
Live input¶
The curve dialog will show a tracker where the current input is located, and will move along the curve based on the live position of the input axis. The tracker is only visible if trackers are enabled in options to show live inputs in the UI.
When live input is enabled, the dialog editor also shows the current value, and the computed output value live.
Curve presets¶
GremlinEx has pre-defined presets for common types of bezier curves, and also has the ability to save any curve as a preset in its own file. The file is saved as an XML file in the same folder as the profiles.
The save preset button saves the current curve configuration to a preset file. The load preset button loads a previously saved preset into the curve editor. This method is helpful to save favorite curve profiles so they can easily be used across different profiles.
Curve copy/paste¶
GremlinEx lets you copy the current curve data to the clipboard, and paste it to a curve editor later.
Symmetry mode¶
GremlinEx can use symmetry mode in which case points left of center will be mirrored to the right of center. In this mode, a center point is added to the curve if it doesn't exist.
Inversion¶
The invert button reverses the curve in the Y axis.
Deadzones¶
Deadzones control if output is generated based on the input value. This is helpful if you have a noisy input (such as an older style potentiometer based input) or to prevent a response within a range (usually this is used with rudder pedals towards the center).
Newer input devices have made this feature a bit obsolete because HAL effect sensors typically do not produce noisy inputs, and it really depends on the type of device as well - rudder pedals are probably the most prone to this and thus where deadzones apply the most.
Deadzones can also be used to suppress a portion of an input altogether, such as a half axis if such a functionality is needed.
The two sliders at the bottom of the dialog control three deadzones:
-1.0 deadzone (from the low end of the range)
+1.0 deadzone (from the high end of the range)
-0.0 deadzone (left of center)
+0.0 deadzone (right of center)
A deadzone defines a part of the curve in the center or extremities that will not respond to inputs while the input is in that deadzone range.
A number of convenience deadzone preset buttons are at the bottom of the dialog to set various typical deazones. The reset button removes all deadzones.
Curve processing order¶
Curves can be applied to input joystick axes, to the vjoy mapper action, and the standalone response curve ex action. The legacy response curve can also be used but will not have all the features in the updated curve editor.
Curves stack, meaning that if more than one curve is defined on an input, the value will be cumulative, which may not be completely helpful but can be in some use-cases.
The curve on the input axis is applied first, followed by the curve dedicated plugins (in the order in which they appear but before other actions), and finally the curves defined in the actual action itself.
Keyboard/Mouse device¶
GremlinEx has an updated special Keyboard device that allows you to map keyboard and mouse button as inputs to trigger actions and containers.
GremlinEx allows you to map unusual function keys F13 to F24 and any QWERTY keyboard layouts (no support for other layouts as of yet), as well as mouse input buttons including mouse wheel actions.
Keyboard inputs¶
Keyboard inputs, as with joystick inputs are shown on the left panel in GremlinEx in the keyboard tab. Inputs can be added, removed and edited (configured). If an input is removed, it will remove any associated mappings. A confirmation box will pop up if an input with content will be deleted.
Use the action and container copy/paste feature to duplicate actions between inputs.
Scan Codes¶
Gremlin Ex has an option to display keyboard scan codes that will be heard by GremlinEx to help troubleshoot the more complex key latching use cases. The scan codes are the keyboard scan codes in hexadecimal that will be listened to to trigger this action. The "_EX" means the scan code is extended. This list is important because GremlinEx will only be able to trigger the actions if it "hears" these scan codes in pressed state at the same time.
Many keys are special - such as the Right Alt key or the numpad keys. For example, the numpad numbers change scan codes based on the state of the numlock key and shift states.
Numlock state¶
The keyboard's numlock state alters the hardware codes sent by the numeric keypad (numpad) keys and can in fact caused the keyboard to return the same low level key presses for different physical keys. This happens for example with arrow keys. When this happens, there is no current way in the low level API used to tell which key was pressed because the codes are the same at the hardware level. Because this is usually enabled by the numlock state, Gremlin Ex offers an option as of 13.40.14ex to turn off numlock if it was on when a profile starts.
This does not eliminate the problem entirely as there are still certain key combinations that will report duplicated keys at the hardware level, without GremlinEx able to tell the difference between keys.
If a key combination is not detected, you can use a keyboard scanner to see if the key windows sees is different from what you expect. There is an option in GremlinEx to display the key scan codes corresponding to a particular key combination, and the keyboard must be able to produce these codes for GremlinEx to act on them.
A free utility to view keyboard scan codes is available here
Virtual Keyboard¶
For input simplicity, GremlinEx now uses a virtual keyboard to show which keys are used for the input selected. It is still possible to listen to keys using the listen button (currently this will only capture keys, mouse buttons will be ignored).
!virtual keyboard](assets/virtual_keyboard.png)
Currently only US layout (QWERTY) is supported for visualization. GremlinEx uses scan-codes (physical keys) on the keyboard so what the key actually says doesn't matter and is only for visualization purposes. I do plan to add localization in a future release so the keys show the correct key name for the current keyboard layout in use.
Selecting a key¶
Click on a key to select it. More than one key can be selected in most modes. When configuring an input and more than one key is selected, GremlinEx will only trigger the container/actions if all the keys are pressed concurrently.
Shift state¶
If you hold the shift key, keys that can be shifted will show their character.
Select single¶
You can select a single key by holding the control key down. This will clear any other selection.
Selected keys¶
Each selected key shows highlighted in the virtual keyboard.
Listen button¶
The listen button allows you to type the keys you'd like to select. This has a limitation in that it will only "hear" the keys that can be pressed. Listen mode replaces the current selection.
Pass-through¶
Keys uses as inputs into GremlinEx are not captured, meaning that all applications will receive the same keys that GremlinEx sees.
There are no guardrails provided - and GremlinEx does not prevent the output application from seeing the keys and buttons pressed to trigger a GremlinEx action. When mapping to a game use care to employ key combinations that make sense and do not conflict with one another.
Special considerations¶
Some actions, like mouse wheel presses, do not have a release associated with them (there is no event fired to "stop" the mouse wheel). When mapping to an output, be aware that the output should be pulsed or otherwise handled if you expect such triggers to be momentary. For example, if mapping a wheel event to a joystick button, use the pulse mode unless you want the button to stay pressed.
Another potential gotcha is to create a loop, wherein the output of an action creates a trigger for an output.
There are no guardrails to encourage flexibility however it is imperative to use this capability with care to avoid odd behaviors.
MIDI device¶
GremlinEx, as of 13.40.14ex, can map MIDI messages and use those to trigger actions.
MIDI is a music oriented protocol to facilitate the exchange of music information between MIDI devices. These devices can be hardware or software devices.
Unlike hardware devices, MIDI inputs must be user defined and added to tell GremlinEx what to listen to. Because MIDI can be cryptic, the configuration dialog allows you to listen to MIDI data and automatically program what it "hears" as an input using the listen buttons. Inputs can also be manually setup if needed.
Gremlin categorizes MIDI messages in that it doesn't look at the value data in the MIDI input stream - rather it looks at the port, the channel, the command, and any specific command data, such as the note number or the controller number.
Gremlin will thus, on purpose, not distinguish between two notes if the velocity is the only thing that changes. Rather, the MIDI value is passed along to the actions as the value parameter, which enables mapping to joystick values easily (see the trigger mode section below)
MIDI inputs¶
All MIDI inputs are supported including SysEx messages. The general process is to add a new input to GremlinEx in the MIDI device tab which will appear on the left. The input can be configured by click on the cog wheel.
Inputs can be deleted via the trashcan icon, or all inputs cleared via the clear all button. Use with causion as if you get past the confirmation box, there is no undo and all the container data will be gone unless you previously copied it to the clipboard. Confirmation boxes only show up if you have a container defined for an input.
MIDI trigger modes¶
The input has three trigger modes for each MIDI input that alter how the MIDI data is processed by GremlinEx.
| Mode | Description |
|---|---|
| Change | Triggers whenever the MIDI value for the current command changes |
| Button | Triggers a press event if the first argument is in the top half of the MIDI command range, usually 63 to 127. The trigger value will be shown. |
| Axis | The input is placed in axis mode, which enables the vjoy-remap container in axis input mode. The range of the MIDI command value is used, so velocity for a note, value for a CC, etc... |
Changing modes¶
If an input already has mapping containers attached, GremlinEx will prevent switching from an axis mode to a button/change mode and vice versa. This is because containers and actions, when added to an input, are tailored to the type of input it is, and it's not possible to change it after the fact to avoid mapping problems and odd behaviors.
MIDI conflicts¶
MIDI input conflicts are possible and stem from the ability to map MIDI messages via different inputs that map to the same or similar message. GremlinEx will scan existing mappings to avoid this as much as possible, however it is not foolproof as there are ways to configure MIDI messages in such a way conflicts may not be detected.
MIDI ports¶
GremlinEx listens to all MIDI ports concurrently so multiple MIDI ports can be used at the same time. GremlinEx will scan for available ports.
If a port goes away after you've configured an input on that port, that port becomes invalid and will not be used for output. GremlinEx will not delete that input however, but GremlinEx will display a warning on each invalid input.
Network MIDI¶
While outside of the scope of this document and GremlinEx, you can easily network MIDI events using rtpMidi. Another utility that is useful is loopMidi. These utilities let you map MIDI input from a device attached to another computer via the network and send that data to the GremlinEx machine. We won't go into details on how to set that up, but the idea is that a MIDI device sends output to a port, and rtpMidi allows that port data to be transferred to the GremlinEx machine. GremlinEx will be able to use that input to trigger events.
important GremlinEx will not listen to MIDI data via the remote control feature. The remote control feature is only for output mapping, not for input. Use the utilities above to network MIDI traffic which is outside the scope of GremlinEx.
Using MIDI from touch surfaces¶
The MIDI input feature in GremlinEx is designed to work hand in hand with "glass" input surfaces like Hexler's TouchOSC or OSCPilot, or any software based control surface that sends MIDI data.
In TouchOSC's case, if you use the button mode in Gremlin to map a particular command, GremlinEx will press the button while the "glass" button is pressed, and automatically release it when the "glass" button is released.
Similarly, "glass" faders and rotary controls can be mapped using GremlinEx's MIDI axis mode. Other modes can of course be used if the idea is to trigger an action if a specific range of values are reached.
MIDI controllers¶
GremlinEx will see any MIDI message so long as the controller shows up as a MIDI port on the machine running GremlinEx (which can be a networked virtual port via rtpMidi). GremlinEx was tested with hardware from MidiPlus, Arturia, and software controllers like Hexler TouchOSC. It will also work with any software that outputs MIDI data.
MIDI troubleshooting¶
The majority of issues will come from messages not being recognized by GremlinEx because the input configuration is causing it to filter (skip) that message. To this end, Gremlin will tell you what it's listening to.
There are some tools that let you visualize what MIDI messages the computer is receiving such as MidiOx, and older but tried and true MIDI diagnostics tool, or something like Hexler Protokol. Both utilities are free. It's always a good idea to verify the MIDI signaling is functional outside of GremlinEx to verify the machine is seeing messages. If GremlinEx cannot "listen" to a message via the listen buttons, it cannot see it.
OSC device (Open Sound Control)¶
See the OSC Device User Guide for connection setup, input capture, a button test, and panel feedback.
GremlinEx, as of 13.40.14ex, can map OSC (Open Sound control) protocol messages as input and use those to trigger actions. OSC is a network protocol over UDP used to exchange information between AV (audio visual) control panels, studio equipment and related software. In GremlinEx's context, OSC is used to get input from control panels and touch surfaces that support the OSC protocol, including faders/knobs, buttons/switches, rotary encoders and sliders, all of which are very useful to use as game input. GremlinEx can receive and send OSC messages. OSC is generally much easier to setup and program than MIDI as it supports text commands and multiple parameters, including floating point and integer values. For more information on the open sound control protocol, visit OpenSoundControl.org.
Examples of what can be achieved using OSC:
- Receive input and control Bitfocus Companion which enables GremlinEx to use input from hardware panels like Elgato StreamDeck, LoupeDeck panels, and other studio control hardware.
- Receive input and control touch surfaces through Open Stage Control, Hexler Touch/OSC or OSC/Pilot, which gives GremlinEx the ability to get input from a tablet, phone or touchscreen.
- Supports these devices over the network so devices do not need to be physically connected to the GremlinEx machine.
Unlike joystick devices and most hardwired HID inputs, OSC inputs must be user defined and added to tell GremlinEx what to listen to. GremlinEx supports any OSC message, although in the current version, limits are imposed on parameter types for ease of processing/mapping to a VJOY device:
OSC messages must consist of a text part, example /this_is_my_test_fader followed by a numeric value (float or int). Extra parameters are currently ignored, but can be provided without error.
Important: all OSC commands must start with a forward slash or they will be ignored. OSC commands also accept one or two numeric parameters, floating point or integer. It is customary for faders and axes to use a value of 0.0 to 1.0 for a range of values, and for momentary buttons to use a value of 1.0 when pressed, and 0.0 when released.
OSC messages that do not include parameters can be treated as an input trigger (press) if the option is selected in the OSC input configuration box. In this mode, GremlinEx will automatically issue an internal release trigger after the set delay has lapsed. This is often necessary because many actions in GremlinEx require both a press and release triggers, although that depends on the desired behavior.
The general case for switches or buttons on panels is for the OSC device to send two messages to GremlinEx. The message should have a single numeric parameter (others are ignored). The parameter is decoded as a release for a value of zero (0), and a press for any value not zero (!= 0). To make things consistent with most OSC control tablets, the convention is to use a value of 1.0 for button presses, and 0.0 for button releases. Note that GremlinEx will use the first parameter either as an integer or a floating point value, either will work.
The general case for rotary encoders is different as these typically can only send rotation pulses, and no release. For these inputs, configure GremlinEx to auto-trigger the release using the "trigger on press" checkbox and set the delay in milliseconds. The delay is the time between the OSC message is received, and the internal release is triggered. Most games require at least 100ms to capture the input, many require 250ms. This varies with the game however testing most games prefer 250ms which is why the default is set at 250ms (quarter second).
OSC ports¶
OSC is a protocol running over UDP, so requires not only an IP address but a port port to listen to, or send to OSC messages. GremlinEx includes an internal OSC server to listen to incoming OSC traffic. The default GremlinEx server (listen) port is 8000. GremlinEx usually uses port 8001 for sending.
Network devices should send OSC traffic to GremlinEx using the IP address of the machine running GremlinEx and the GremlinEx server port (8000 by default). Do not use the loopback IP address (127.0.0.1) - use the assigned IP address. For dual homed machines (machines with more than one network interface), ensure you use the primary IP address.
When sending OSC data from GremlinEx using the *map to OSC" or "map to OSC ex" actions, be sure to also specify the IP address and listen port of the receiving panel.
GremlinEx can send itself messages, in which case the OSC packet will be internally bridged and will not go over UDP. This enables hardware connected to GremlinEx to send OSC messages to itself, or the network devices.
The port can be configured by your OSC utility, just make sure GremlinEx listens on the correct port for messages. The output port is not used by GremlinEx currently except to configure the OSC client. The output port is always 1 above the input port, so 8001 if the default 8000 input port is used. If you are using a firewall, make sure the port is configured to receive.
The GremlinEx OSC server port is configured in options. GremlinEx uses by default the current non-loopback IP of the machine. Currently, that IP cannot be localhost (127.0.0.1), it may work in some configurations however it may not. This makes sense because any OSC input device will typically run on a separate host, and thus the GremlinEx machine needs to have network connectivity.
OSC port configuration¶
Ports should be used to avoid conflicts with each other. Recommend defaults are:
- port 8000 to send data to GremlinEx
- port 8001 to receive data from GremlinEx
- Gremlin server port: 8000
- Gremlin OSC map send to port: 8001
- Bitfocus server admin port (web server): 8010
Example for GremlinEx running on the same machine as Bitfocus, and Open Stage Control running on a different network machine:
| Item to configure | Role | IP | Port | Description |
|---|---|---|---|---|
| Bitfocus web server | admin | GremlinEx IP | 8010 | Admin web site |
| Bitfocus OSC generic module | send | GremlinEx IP | 8000 | Send to GremlinEx |
| Bitfocus OSC generic module | listen | GremlinEx IP | 8001 | Listen to GremlinEx |
| Open Stage control | send | GremlinEx IP | 8000 | Send to GremlinEx |
| Open Stage control | listen | Open Stage IP | 8001 | Listen to GremlinEx |
| GremlinEx (OSC configuration) | listen | GremlinEx IP | 8000 | Listen to Open Stage or Bitfocus |
| GremlinEx (map to OSC) | send | Open Stage IP | 8001 | Send to Open Stage |
| GremlinEx (map to OSC) | send | GremlinEx IP | 8001 | Send to Bitfocus |
GremlinEx IP = primary IP address of the computer running GremlinEx and Bitfocus (do not use localhost or 127.0.0.1)
Open Stage IP = primary IP address of the computer running Open Stage Control attached to a touch screen.
OSC related firewall rules¶
In Windows 11, the Windows Firewall will automatically configure itself when GremlinEx attempts to open the port, and prompt to allow this traffic the first time. This prompt wil typically appear for each new port used. However this behavior varies with different configuration and policy settings in Windows. A firewall rule may needed to be setup to allow UDP traffic on the ports used for OSC traffic. If the firewall is not configured, the OSC traffic is not allowed to communicate so the packets will not transmit and GremlinEx will not be able to receive or send OSC data over that port. The same is true of any OSC device in that ports must be opened and allowed to communicate.
OSC test tool¶
Hexler provides a free analysis tool for OSC packets: Hexler Protokol
OSC inputs¶
All OSC inputs must be unique or a warning will be triggered in the UI. An input maps to a specific message type. In the current release, OSC inputs support the following input modes:
OSC Trigger modes¶
| Mode | Description |
|---|---|
| Change | Triggers whenever the value changes |
| Button | Triggers a press event if the first argument is non-zero, and a released event when the first argument is zero. For singleton commands with no parameters, such as for rotary encoders, use the trigger on message option so have GremlinEx issue an autorelease. Note that a release is not always needed but most actions in GremlinEx expect a trigger on press followed by a release at some point. |
| Axis | The input is placed in axis mode, which enables the vjoy-remap container in axis input mode. A range value can be provided that tells GremlinEx the input range, it can map it to the VJOY range of -1 to +1. The default is 0 to 1. |
| Command Mode | Description |
|---|---|
| Message | The input uses the message (string) part of the OSC message as the input identifier |
| Message + Data | The input uses the complete message as the input identifier, including any arguments. |
The recommendation is to keep it to Message mode as it makes OSC programming much simpler.
A typical OSC command will thus be /my_command_1, number where number is:
| Value of first argument | Description |
|---|---|
| range min to range max (usually 0 to 1) | Axis mapping -1 to +1 |
| zero | Button release |
| non-zero | Button press |
OSC Message Requirements¶
GremlinEx can accept any OSC message, with or without parameters.
| Example OSC Message | Parameter | GremlinEx OSC Input Mode | Description |
|---|---|---|---|
| /set_speed | 0.0 to 1.0 | Axis | Axis mapping -1 to +1 |
| /toggle_lights | 0 or 1 | Button | Trigger a momentary input with 1 being the press event, and 0 being the release event. Any non zero value will be considered to be a "press". |
| /toggle_gear | none | Button | Requires autorelease enabled. Trigger a "press" when the message is received. GremlinEx automatically generates a "release" event after the delay has lapsed. |
| /flight/trim_set | 0.0 to 1.0 | Axis | Axis mapping -1 to +1 |
Messages must start with a forward slash.
A message can be interpreted as an axis if the first parameter provided is a floating point value, usually 0.0 (min) to 1.0 (max) which matches most OSC control surface defaults for faders and sliders.
Messages for button control should also have a numeric parameter. A value of 0.0 (or 0 for integer data) means released. A non-zero value means pressed.
If a message has no parameters, and the OSC input in GremlinEx can be setup to auto-release on message receipt. In this situation, GremlinEx treats the receipt of the message as a "press" trigger for the button, and it will automatically generate a "release" trigger after a delay has lapsed. This enables GremlinEx to use OSC input with no parameters.
If the message has no parameters, a global option can be set in OSC options to automatically consider all messages with no parameters as trigger buttons, without the need to enable the autorelease mode on the button.
Warnings will be placed in the log file if an OSC message arrives that is not suitable for the current GremlinEx input configuration and options selected. For example, an input set to Axis mode when the message has no parameters. In these situations, GremlinEx will just issue a warning in the log file and ignore the input.
OSC Mode Considerations¶
| GremlinEx OSC input mode | Description |
|---|---|
| Axis | The input will look like an axis to actions and containers with an input range of -1.0 to +1.0. The first argument in the received OSC message be in a range 0.0 to 1.0. |
| Button | The input will look like a button to actions and containers. The first argument (integer or floating point) should be 0 for "released", and non zero for "pressed". |
| Button (autorelease) | The input will look like a button to actions and containers. GremlinEx will issue a "press" even on message receipt, and generate an automatic "release" when the delay has lapsed. |
OSC Bulk Import¶
Starting with GEX m76RC29, it is possible to import multiple OSC message configurations together from a text definitions pasted into GEX.
Each line corresponds to an OSC input in the format command [mode]
The mode is defined in the table below
| Import Mode | Description |
|---|---|
| (blank) | imports as a button, with a single parameter. If the parameter is non-zero, the input will be pressed. if 0, it will be released. |
| b | Same as (blank). imports as a button, with a single parameter. If the parameter is non-zero, the input will be pressed. if 0, it will be released. |
| bnp | Autorelease button. When a message is received, the mapping will be triggered pressed, and after a period of autorelease which defaults to 250ms, it will be released. |
| a | Axis mode. The input will look at the input parameter which is expected to be a floating point value between 0.0 and 1.0. This will map in GEX as a joystick axis -1.0 to +1.0. This is typically used with faders and sliders on the OSC side of things. |
| e | Encoder mode. |
| c | Change mode. A trigger will be issued whenever the message is received. |
Bulk imports can include duplicated entries. The last entry found will be imported.
If the input is already defined, the entry will be ignored (log file will list which items are duplicated).
States¶
For setup instructions, see the State Device User Guide and the companion Map to State User Guide.
Starting with 1.0ex m74, GremlinEx includes a state machine. States are used in multiple use-cases to solve simple to complex mapping scenarios. For example states can help with latching, triggering the same mapping from multiple inputs, and conditional mapping based on boolean logic on multiple states without having to revert to a custom user plugin.
What is a state?¶
A state is an internal entity that only exists in memory at runtime. States have a unique, case-insensitive name. States have an on/off behavior (also known as pressed/released or true/false) that can be set or read by profiles at runtime. States can be used to implement a state machine in a profile, and behave like virtual on/off or boolean switches. They are either set/on/true or unset/off/false. States initialize to a default starting value when a profile starts. States can then be changed at runtime by the map to state action anywhere in the profile, via a macro, or by a user plugin via the StateData() API. States can be read as a condition (state condition) that performs a check on the state to see if the conditioned container or action should execute or not. States are also mappaple via the state device tab, so a state can trigger a set of actions when their value changes.
Attributes of a state:
- States are stored in a profile and specific to that profile.
- States are defined in the state device tab.
- States can only have an on or off value.
- States have no mode. Mappings attached to states scope to the entire profile regardless of the current execution mode.
- States (like buttons) trigger whenever their value is changed. A set (on) value will include a "press" action. A clear (off) value will trigger a "release" action.
- States can be defined using boolean expressions using other states. If a state in the expression changes values, the expression is re-evaluated.
Remember to save the profile if you have created states as they are only saved upon profile save.
State mappings¶
Any action that can be mapped to a joystick button can be mapped to a state. Linear (axis) inputs are not supported because states only have two values (on or off).
Default value¶
When a state is defined, it can be given, at profile start, an or or off value. When the profile starts, the state wil be initialized to this value.
Note: As of m76T40, a state can also be set using the new profile start/stop mappings in the Mode/Profile device via the map to state actions.
Setting a state¶
GremlinEx can manipulate states at runtime using the map to state action or in a macro. These actions let you set (turn on) or clear (turn off) a state.
State expressions¶
States can be defined as a boolean expression from other states. In this case, the state is not directly set by an action. Instead, whenever a state value referenced in the expression changes, the expression will be re-evaluated and the new state derived.
At profile start, the value of the expression is evaluated based on the start value of dependent states.
Supported boolean expressions¶
GremlinEx supports standard boolean operators. In the table below, 0 represents the cleared (off) state or FALSE value. 1 represents the set (on) state or TRUE value.
| Operator | Description | Values | Comment | |||
|---|---|---|---|---|---|---|
| AND | boolean AND | 0 and 0 = 0 | 1 and 0 = 0 | 0 and 1 = 0 | 1 and 1 = 1 | Both values must be true |
| OR | boolean OR | 0 or 0 = 0 | 1 or 0 = 1 | 0 or 1 = 1 | 1 or 1 = 1 | One value must be true |
| NOT | boolean NOT (unary) | not 0 = 1 | not 1 = 0 | Flips the value | ||
| XOR | boolean XOR | 0 xor 0 = 0 | 1 xor 0 = 1 | 0 xor 1 = 1 | 1 xor 1 = 0 | True if values are different |
Evaluation order¶
NOT takes precedence as a unary operator over all other operators. AND takes precedence over OR and XOR. OR and XOR have equal precedence. Parenthesis can be used to change the evaluation order.
Example of state expressions¶
Using A, B, C, D as unary states we can define:
A = 1 B = 0 C = 1 and D = 0
| Expression | Result | Explanation |
|---|---|---|
| not A | 0 | inverse of A |
| A or B | 1 | either a or b, true because A is 1 |
| not (A or B) | 0 | inverse of (A or B) |
| B or D | 0 | either b or d, false because both B and D are 0 |
| A and B or C | 1 | true because what is evaluated in (A and B) or C, or 0 or 1 = 1 |
| A and (B or C) | 1 | true because the parenthesis causes B or C to be evaluated first, 1 or 1 = 1 |
| A xor B | 1 | true because A and B are different |
| A xor C | 0 | false because A and C are the same |
| A xor (B or C) | 0 | false because both values evaluate to the same (A) and (B or C) |
| A or B or C and D | 1 | true, C and D is evaluated first, so 0, however the overall expression is true because A = 1 |
Note that expressions, like states, are not case sensitive.
Interacting with states¶
State Gotchas¶
Keep state dependencies flowing from ordinary input states to expressions and then to output mappings. Avoid expressions that refer to themselves or form a circular chain, such as A referring to B while B also refers to A.
Check mappings attached to states as well: an output that changes an earlier state can feed back into the same chain. Test the source states and expressions in the input viewer before adding those outputs.
Creating a state¶
States are added to a profile via the special State Device. Click on the add button.
Editor - regular state¶
A regular state is not based on an expression. It only defines a start value when the profile is executed.
Editor - expression state¶
An expression state is based on other states using a boolean expression. The state is automatically computed when one of states in the expression changes.
State names¶
States must have a unique name in a given profile.
Names may not include any spaces. Separate words using the underscore character.
Names are not case sensitive (so my_State is the same as my_state).
States are tracked internally by ID (as of m76T28) so a name change will also update all expressions automatically.
Deleting a state¶
Before deleting a state, remove or replace its references in expressions, Map to State actions, conditions, State containers, and macros. Remove it from the State Device list, save the profile, and reopen it to check the remaining selections.
State visualization¶
The input viewer includes a state repeater that can be used to visualize states as they change.
State use-case scenarios¶
When would you use a state?
State as a condition¶
Because a state is like a virtual button, it can immediately used instead of any button condition. However because a state can be setup as an expression using other states, it can also be used for complex latching situations when a trigger should only execute if several things are true, or only if some of them at true, or inverting that test using the NOT operator.
An example would be the need to trigger a joystick button while at least one of two physical inputs is pressed. In this example, we'd create two states, A and B with a default value of off. We would define a third state, called a_or_b, defined as:
A or B
This will evaluate to True if either V1 or V2 are held.
For each physical input, we will add a map to state action to set the state to on whenever the button is pressed:
Note the use of the hold option, which means the state will be on when the button is pressed, and off when the button is released.
At profile runtime, VJOY device 1 button 1 will be triggered whenever either button is pressed/held on the two inputs. This can also be used to map the same action to more than one input, so that to change the mapping of the output, it only needs to be changed in the state, not for each inputs. This is a simple use-case but can be made much more complex with more elaborate boolean expressions. For example, an expression of
C and (A or B)
would introduce a latching, which means state C (however triggered) would also need to be true for the mapping to trigger.
Profile Settings¶
Profile settings is a tab that lets you configure various profile options.
- select which VJOY device can be used as an input device
- set default values for VJOY axes
- select the default profile start mode
- set the default macro execution delay between steps
Note: Profile modes are defined in the mode dialog.
Changing modes on existing mappings¶
If an input already has mapping containers attached, GremlinEx will prevent switching from an axis mode to a button/change mode and vice versa. This is because containers and actions, when added to an input, are tailored to the type of input it is, and it's not possible to change it after the fact to avoid mapping problems and odd behaviors.
Gamepad (X-Box controller)¶
As of 13.40.15ex, GremlinEx supports the VIGEM virtual X-Box 360 controller output. Up to four (4) devices can be configured for output.
| Output | Description |
|---|---|
| Left stick X | (axis) outputs left stick, X axis |
| Left stick Y | (axis) outputs left stick, Y axis |
| Right stick X | (axis) outputs right stick, X axis |
| Right stick Y | (axis) outputs right stick, Y axis |
| Left trigger | (slider) outputs left trigger slider |
| Right trigger | (slider) outputs right trigger slider |
| Left thumb | (button) outputs the left thumb button (usually left stick push) |
| Right thumb | (button) outputs left thumb button (usually left stick push) |
| A,B,X,Y | (button) outputs the A/B/X/Y buttons |
| Left/Right shoulder | (button) outputs the left and right bump buttons |
| Guide/Start/Back | (button) outputs the guide, start and back buttons |
Requirements¶
The VIGEM Bus must be installed - this is what provides the virtual gamepad controllers similar to what VJoy does, but for game controllers.
VIGEM bus can be found at https://github.com/nefarius/ViGEmBus. While the driver is no longer updated, it is a signed driver under 64 bit Windows 10 and 11. The driver, once installed, will show under Device Manager/System Devices as "Nefarius Virtual Gamepad Emulation Bus".
Once installed, GremlinEx will automatically detect the VIGEM Bus driver, and will create a single device to start (unless this was previously changed in options). The necessary DLL is included with GremlinEx and loaded automatically, no additional Python library is needed. To detect the new virtual gamepad support, GremlinEx will need to be restarted.
IMPORTANT: no device will show in control panel or HIDHide until GremlinEx runs, as GremlinEx creates the device at runtime. GremlinEX creates the devices when it starts, and removes them when it exists, regardless of what profile is running or not.
HIDHide interaction¶
There is nothing special to do with HIDHide. Because GremlinEx creates the virtual gamepad devices at runtime, they are visible to the game automatically by default, even if other devices are hidden.
The devices will go away when GremlinEx is not running.
Number of devices and device lifecycle¶
GremlinEX supports up to four virtual X-box controllers. The number of devices created is configured in the options dialog, which can be set from 0 to 4. 0 means no device output.
GremlinEx will create the devices when it runs (no profile needs to be active). The devices will go away when GremlinEx exits.
VIGEM devices will not show in GremlinEx's device bar because there are no configuration items to set so while the devices exist, they are not displayed.
Mapping to a gamepad device¶
Mapping to a gamepad is via the map to gamepad action. The action is no different from mapping to Vjoy and functions the same way.
The action supports either joystick, hat, or any momentary input. The action will only show mappings suitable for the input selected, so it will show gamepad axes if the input is a linear input, and button type mappings if not.
It is possible to curve an axis input into the gamepad and reverse its input via the response curve action if needed.
Gamepad input¶
Unlike VJOY, GremlinEx does not currently support a virtual gamepad used as input. However a hardware gamepad (such as an X-Box One controller for example) will show up in GremlinEx as a regular joystick input in the device tabs and can be mapped like any other Joystick controller.
Profile¶
A profile holds a mapping of inputs to action.
Profile association¶
A profile can be associated with an executable in options, and GremlinEx can automatically switch to that profile when the associated process receives the focus. By default this is not enabled as loading processes automatically can create a bit of lag while the process is loaded, especially if a large / complex profile, but the feature is available. The other recommendation is to not automate this while setting up or tweaking a profile to simplify the editing process especially if you constantly switch focus between processes.
Profile modes¶
A profile can have multiple modes. A mode is a set of unique mappings, specific to that mode. The default mode being called "Default" and is the starting mode. Modes are not necessary. They are provided for more complex mapping scenarios.
Mode background¶
It's important to understand what modes do as it will impact mapping behaviors. Every mapping (container/action) is attached to a specific input (device and input within that device) as well as its mode.
If the mode changes, a new mappings set is activated and replaces the mapping set from a different mode.
If an action starts in one mode, results in a mode change, any other callbacks by this action may not execute correctly as the mapping has changed while executing.
Default mode¶
Every blank profile starts with the default mode, named "Default". The name of the profile can be changed if needed.
Every profile must have at least one mode.
Additional modes are optional.
Nesting modes¶
Modes can be nested, meaning that a mode can itself contain other modes. A child node inherits actions from a parent mode if the child mode does not define these inputs. This means that the actions mapped to the parent mode (or its parent and so one) cascade into a sub mode if that device/input is not mapped. GremlinEx will walk the chain up to find the first mapped action for that input, and execute it if it finds it.
If this behavior is not desired, the mode can also be a mode without a parent, in which case it will be a standalone mode without inheritance.
Mode addition/removal¶
Modes can be added or deleted. Deletions can cause a loss of data as mappings are attached not only to an input, but a specific mode, so avoid deleting modes.
The last mode cannot be deleted. A profile must have at least one mode defined.
Mode/Profile device¶
A special mode device, appearing as the Mode/Profile tab defines a pair of virtual buttons triggered by GremlinEx on mode change.
One triggers when the mode is entered. The other triggers when the mode is exited (meaning, the before the new mode that was selected is activated).
Both inputs function as buttons, so containers and actions that support buttons can be mapped to these special inputs.
The mode enter and mode exit virtual buttons are unique to each mode, so each can have a different set (or none).
The mode enter trigger will also trigger on profile start for the mode selected as the default startup mode. The trigger will happen after any settings on the settings options are applied.
Mode enter / exit use-cases¶
Examples of how mode entry/exit mapping can help solve common mapping problems, because they always execute regardless of physical input state.
- every mode can initialize a known setup as actions like Map to Vjoy can set specific values on axes or activate/deactivate buttons. If the device enabling is turned on in options, the Control action can also enable/disable specific inputs.
- Text to speech will correctly execute on mode change. Note however that the special variable ${current_mode} will reflect the current mode, which may not be the mode the trigger is defined in because of how the wiring works.
- Mode exit can be used to "clean up" or reset a state when the mode changes to a different mode, or execute actions to re-enable a device for example.
General mapping process¶
GremlinEx shows near the top of the UI a tabbed list of all detected HID hardware, including non-hardware input items like MIDI and OSC which also function as inputs.
For complex profiles, the first order of business is typically to setup the modes for the profile if you have complex mappings to do, typically if you need to have multiple mappings for the same inputs - this can be for example a "flight" vs a "walking" mode, or a "turret" mode vs a "cockpit" mode. You create modes in the mode configuration dialog. There is however no requirement to do modes first as modes can be added later if need be.
Select the editing mode at the top right of the UI from the drop down which will select the profile mode being edited. All mappings will be attached to this mapping.
Mappings for another mode will not be displayed from another mode.
The general idea is you will select one of the input tabs, selecting the hardware or virtual input device. GremlinEx will show the detected inputs for the selected device. If the device is a keyboard or MIDI or OSC, the input will also need to be defined. Joystick inputs will show detected axes and buttons and hats for that input as they are reported by the hardware.
Enable vJoy devices as inputs in the Settings tab when another application supplies their values. Use states for internal profile flags, and check for feedback loops if a profile reads and writes the same virtual device.
Once you have selected the input (or created one) on the left side of the UI, you can add one or more containers to that input.
Remember to save changes via the save button as profile changes are not saved automatically. Save the profile to an XML file in your chosen location, and keep its companion JSON file with it. Use Actions → Open GremlinEx folder to locate the default user data folder.
It's possible to manually edit the XML file if you'd like, however if you do, make a backup of the original XML file in case an error occurs.
User plugins¶
User plugins are Python files that can be attached to a profile via the settings tab. Python programming opens the door to very complex scenarios not easily achievable via the built-in container and action types, and recommended for advanced users only. However user plugins are often the fastest and easiest way (depending on your perspective) to achieve very complex logical mappings in GremlinEx.
Note: plugins are reloaded every time a profile starts which allows for fast bug fixing. Exceptions will be output to the dialog. However if the plugin references other modules, these may not be reloaded until GremlinEx is completely reloaded due to the way Python bindings work. GremlinEx has no control over this.
Containers¶
Containers are attached to the selected input and determine how its actions are triggered. Use Basic for a direct mapping, Press/Release for separate commands on each edge, Tempo/TempoEx for short and long presses, and Repeater for repeated pulses. See the container reference for the full list.
The Sequence container runs complete action sets as timed steps. The State container selects action sets using a state; it is useful for alternate command layers without adding a separate condition to every action. See using the State container.
Actions¶
Actions are added to containers for each input type. In GremlinEx, some actions are compound actions, meaning, they create their own inputs based on the input they receive, so these actions can have their own containers. An example of this is the Gated Axis action - which can trigger additional actions based on the position of an input axis.
Actions are aware of the type of input they are being attached to, and not all actions support all input types. Some actions work only with joystick axis input (example, Gated Axis) while others only work with button or keyboard inputs (example, mode switch).
Action priorities¶
Some actions are special - meaning - they need to occur after other prior actions in the execution sequence for a given input. The priority is currently hardcoded in each action plugin which will be fine for all the provided actions. For example, a joystick axis mapping action must occur after a response curve action (that changes the input to a new value), and a mode switch action occurs after all other actions.
Container priorities¶
Use a container's priority setting to order containers attached to the same input. Lower numbers execute first; the available range is 0 to 999. Give containers different values when their order matters, since equal priorities do not establish an order. This is separate from the action-specific priorities described above.
For example, give a state-updating container an earlier priority when a later container on the same input tests that state. Use Sequence when commands need explicit steps, delays, or repetition rather than relying on container order for timing.
General Action Types¶
Choose the action for the destination or transformation you need. The action reference lists the available actions and supported input types.
- Map to vJoy: virtual joystick axes, buttons, and hats, including button/encoder-to-axis controls and merged axes.
- Map to GamePad: virtual Xbox controller output.
- Map to Keyboard/Mouse Ex and Map to Mouse Ex: keyboard combinations, mouse buttons, wheel commands, and pointer output.
- Map to State: ordinary state updates, grouped targets, pulses, and startup synchronization.
- Gated Axis, Response Curve Ex, and Map to AFCS: axis processing and position-based commands.
- Play Sound/TTS: audio files, local speech, Edge-TTS generation, and playback control.
- Map to Stream Deck and Map to Overlay: page controls, feedback, and panel updates.
- Map to OSC/OSC Ex, Map to SimConnect, and Map to Octavi IFR1: integration with external software and devices.
- Switch Mode, Temporary Mode Switch, Cycle Modes, Control, and KVM: profile, module, and output-routing controls.
- Macro, Run Process, and OS Action: command sequences and application or system commands.
Control an axis with buttons or an encoder¶
Use Map to vJoy's button-to-axis controls when the source supplies presses or encoder ticks instead of an axis value.
- Select the source input, add Map to vJoy, and choose the destination device and axis.
- Choose the stepped-axis action mode, then select the control under Button to Axis (step) Mode: Velocity, Stepped, Stepped+PID, Encoder, or PID.
- Configure the increase/decrease inputs and the mode's speed, step, or controller settings. Set an initial axis value if required.
- Start the profile and check the destination axis while operating the controls. Verify the full travel, direction, and stopping position before binding it in a game.
Presets provide starting values for the selected control mode. Use the worked setup and mode-specific instructions to choose between continuous movement, fixed steps, encoder movement, and movement toward a target. The same guide covers output curves and axis merging.
Run actions in a sequence¶
Use Sequence when each step needs its own action set and timing. A Macro action can be included in a step, but Sequence also accepts other supported actions directly.
- Add a Sequence container to a button input.
- Use Add Step to create two steps and configure a simple output in each.
- Select Normal (run once), enable Execute on press, and disable Execute on release for the first test.
- Set Step Autorelease delay (ms) to
125and Step Interval Delay (ms) to300so the outputs are easy to observe. Keep Continue on trigger reset enabled if a tap should complete the sequence after release. - Save, start the profile, and press the source once. Adjust the timing for the target application after confirming the step order.
Choose Toggle to start and stop a loop with successive triggers, Loop to repeat while held, Wiggle for variable step selection/timing, or Step to advance one step per trigger. Individual steps also have repeat controls. See the Sequence guide for these modes, startup/resume settings, and worked examples.
Use Import Text… in a Sequence container to build it from commands and Export Text… to copy its definition. Sequence text commands and examples
Play sounds and generated speech¶
Add Play Sound/TTS to an input for audio feedback. Select the mode before configuring its source:
- For Audio file, choose a WAV or MP3 file. For TTS (local) or AI (Edge-TTS), enter text, choose a voice, and generate the speech asset.
- Preview the audio. Leave the destination on the current Windows default output or select a fixed playback device.
- Configure volume and any required trim, fade, loop, or queue options.
- Save, start the profile, and trigger the input. Use another action in Stop Playback mode when a separate control should stop audio.
The shared queue can serialize playback or allow overlapping cues, including output to different audio devices. Its blocking controls apply to audio playback; they do not pause the profile or make a Sequence step wait for the sound to finish. Use explicit sequence timing when that spacing matters.
Local TTS uses installed system voices. New Edge-TTS generation requires network access and FFmpeg, and generated speech is cached for playback. See the Play Sound/TTS guide for generation, cache management, device selection, and queue options.
Profile edit time vs runtime behavior¶
When the profile is activated (either manually or automatically by process for example) changes the behavior of GremlinEx.
Edit time¶
Use the input indicators and axis repeaters to see the current source value while configuring mappings. The input viewer provides additional input/output displays, Select Used, and manual vJoy/state controls. Action previews and the overlay designer help check individual settings before starting the full profile.
Run time¶
When a profile runs, the runtime engine executes mappings and most mapping editors are unavailable. Some edit-time displays stop updating to reduce UI work. Use the status bar to check the active runtime mode and local/remote routing, and the activation control to check whether the profile is running.
Live overlays, Stream Deck feedback, recognition, and other enabled runtime services continue according to their configuration. Use the input viewer or target application to verify the output, then stop the profile before making further edits.
Profile map visualization¶
GremlinEx has a dialog visualizer to show, in text form, the current mappings and modes for the profile. This text can be copied to the clipboard and pasted as plain text.
Dragons¶
This action is an experimental feature.
Make sure that if you use a press action, there is a companion release action somewhere. If that doesn't happen, you can press the key on your keyboard and it will release the key.
When a key is pulsed, the release will occur regardless of input state or conditions.
Merged Axis action¶
For new m77 mappings, use the Map to vJoy merge controls or the AFCS designer. The description below applies to the older Merged Axis action used by existing profiles.
This action is similar to the profile wide merged-axis functionality via the menu, with some key differences:
- the action can be added to any joystick axis input
- the action only sends its output to sub-actions it defines
- the action includes an option to invert the output
Lower and upper inputs¶
The action lets you select two input operators from the list of axis input (physical or virtual) to participate in the merge operation. While the same operator can be selected for both upper and lower entries, in this case nothing will happen but it does let you define sub-actions unique for that input if needed, which can be of use in some use-cases.
The inputs can be associated with the hardware input mapping this action, however this is not a requirement. The hardware input in this case is used as a placeholder to add a merge action to the profile, the only requirement is the action has to be added to an axis input. The input of that hardware is not used in the merge operation unless the input specified in the action happens to be the same as the hardware input the action is mapped to.
Operations¶
| Operation | Description |
|---|---|
| Sum | The two axis inputs are added and clamped to -1.0 to +1.0 range |
| Minimum | The smallest of the two inputs is output |
| Maximum | The largest of the two inputs is output |
| Average | The average value is used as the output - this is typically used to combine two axes into one for brake pedals for example |
Invert¶
The checkbox inverts the computed output.
Output¶
The output helps visualize the computed output while the profile is not running the computed output based on the live input. When the profile starts, the updates are disabled. The updates will resume when the profile is stopped.
Action configuration¶
The button opens a dialog showing the list of sub-containers and sub-actions that will receive the merged axis information and process it for mapping.
The actions defined in this dialog are only executed for this action and will not be visible to other actions defined in the profile.
Each merge axis action contains its own sets of sub-containers/sub-actions.
Simconnect (MSFS)¶
GremlinEx uses Simconnect to interface with Microsoft Flight Simulator(R) 2020 and 2024. Simconnect is the API provided by Microsoft/Asobo to interact with the simulator. GremlinEx implements a two-way interface to Simconnect, and provides one action that can be used to map a hardware input to a simulator control or axis via Simconnect. The two-way functionality is accessible via user plugins if needed, and internally used to detect the active aircraft to handle profile mode changes based on the aicraft type.
Concept¶
The GremlinEx concept for working with MSFS is to setup a (single) profile for MSFS that contains as the default mode all generic mappings for controls that are commmon to every aircraft aircraft (example, a gear handle, pause/unpause, lights). The profile can then have a submode for each mapping specific to an aicraft (example, throttles or condition levers). This allows a single profile to be used for all aircraft and have different configurations for each, such as curves, gates, and simvars specific to the aircraft being flown.
GremlinEx provides an automatic mechanism to switch profile modes for each aircraft based on what it has detected is the active aircraft. This is dynamic so when a new aicraft is loaded, the mode, if defined in options, will be activated if it exists in the profile.
As of this version, GremlinEx must run on the same computer running MSFS. This is a MSFS requirement.
WASM module¶
GremlinEx includes a custom MSFS WASM module written in C++ that gives GremlinEx the ability to use gauge API (WASM) expressions, get a list of simulator variables defined by add-ons, and get values from internal variables via SimConnect. This functionality gives GremlinEx the ability to control add-on cockpits that are not controllable with the base SimConnect API functionality. This functionality does not currently exist in the current SimConnect SDK.
The module must be installed in the Community folder in MSFS. The location of the Community folder varies with the version of MSFS and the method of purchase. Here is a helpful article on how to locate this folder on FlightSim.to.
The WASM module is included in GremlinEx as a zip file containing a single folder called gremlinex-module. To install the module, ensure MSFS is not running, and they just copy the folder ** gremlinex-module** in its entirety the Community folder. Restart the simulator.
Configuration¶
The Simconnect configuration is accessible via the tools menu, or via the configuration button on the action itself.
The configuration dialog can automatically scan the community folder for the list of locally installed aircraft (add-ons). With MSFS 2024, some aicraft can be streamed and they are stored encrypted locally on the computer so GremlinEx. Those will need to be manually entered in the configuration dialog as GremlinEx cannot detect those automatically.
If you would like to use the mode mapping feature, you will need to make sure there is an entry for each aircraft variant as reported by the sim to a profile mode. If no entry exist, the default mode will be used.
The configuration, if MSFS is running, can show you the active aircraft detected at the top of the window.
Map to Simconnect Action¶
The map to simconnect action lets you map a simvar or event to the simulator. GremlinEx supports simple triggers (send a command to the simulator), send a fixed value (usually for events that require an on or off status, or a specific value), and a ranged output, usually for throttles, flaps, condition levers (any axis type).
GremlinEx uses a normalized axis range of -1 to +1 for the input, and this gets mapped to the range used by the simvar.
Important: Simconnect can have numerous entries for the same function (example, throttles), and not all aircraft respond to these entries. Consult the documentation of the specific aircraft, especially third party add-ons, for the specific Simconnect variables they use as input.
General flow and connectivity¶
It's recommended that you run MSFS first before you activate a GremlinEx profile: GremlinEx will immediately attempt to connect to MSFS via Simconnect when the profile starts, or when in the configuration window. GremlinEx will enter a retry mode if it cannot connect, and eventually give up. To re-attempt the connection, you will need to stop the profile, and start it again, or close the configuration dialog and open it again.
Attempts can time-out and fail for many reasons, first and foremost is that Simconnect is not available immediately when MSFS runs. It can take several minutes after the simulator is started before Simconnect is available. A rule of thumb is that Simconnect is only available when the simulator's interface is available and loading has completed. MSFS can take a very long time to load.
For the automatic mode switching to happen, two requirements must be met: (1) an entry (case insensitive) must exist in the configuration dialog that maps the specific aircraft variant to a mode you wish to use. The aircraft variant name is unique across all aircraft in the simulator and is specified by the add-on's configuration and is unique for each variant. That name can be very cryptic. (2) a corresponding mode must exist in the profile. The mode can be anything you want, and indeed, can be re-used by multiple aircraft where it makes sense.
In the GremlinEx configuration options, you can enable verbose Simconnect mode that will add detailed entries in the log file of the interactions with Simconnect - including status, what aircraft is detected and when it is detected, and data GremlinEx is sending via Simconnect.
Tips¶
The log file (with verbose Simconnect mode enabled) will record detailed entries of any problems or errors, such as connectivity errors and data sent/received.
The main issue is usually that the profile is activated and Simconnect is not available. This can be easily fixed by stopping the profile, waiting for MSFS's user interface to be active, and then start the profile.
The other issue is that the data sent to MSFS isn't used by the aircraft being flown, or the data is out of range/invalid.
The mode lock features in GremlinEx's Simconnect options will freeze the mode to a specific mapping and will disable any mode change (switch mode, cycle mode) in GremlinEx to prevent inadvertent mode changes.
Range container¶
The range container is a container designed to break up an axis input ranges into one or more actions tied to a particular range. While something like this can be done with conditions, the range container is much easier to setup than using conditions.
The idea of a range container is to setup a range of axis values that will trigger one or more actions. As many actions as needed can be added. An example of this is mapping a flaps axis to distinct keys, or setting up button presses based on the value of an input axis, which is helpful for example, for throttle setups on some flight simulators to setup detents.
The range container has a minimum and a maximum and each boundary and be included or excluded to define the range.
There is a convenience button that will create automatic ranges to an axis: you specify how many axis "brackets" you need, and you can give it a default action. This will create range containers for the axis automatically and compute the correct bracket values for the count provided.
The Add button adds containers. The add and replace button replaces all the range containers with the new range value (use with care as it will blitz any prior range containers).
The range container is designed to work with joystick buttons or the enhanced keyboard mapper (map to keyboard ex)
Ranges¶
All joystick axis values in GremlinEx are -1.0 to +1.0 regardless of the device, with 0.0 being the center position.
Include/exclude flag¶
Each bracket can include or exclude the value. Think of it as greater than, versus greater or equal to. This is use to include or exclude the boundary value when GremlinEx is determining if the action should trigger or not.
Symmetry¶
The symmetry option applies the opposite bracket as the trigger. So if the bracket is (0.9 to 1.0), in symmetry mode the bracket (-1, -0.9) will also trigger if the axis is in that range.
Latching¶
The range container is latched - meaning that this special container is aware of other range containers in the execution graph. The latching is automatic and ensures that when the axis is moved to a different position, prior active ranges reset so can re-trigger when the axis moves into their range again, so the container has to be aware of other ranges.
Dragons¶
This container is an experimental feature.
The range mapper is not designed to work with the default keyboard mapper as that will cause stuck keys, because of how the default keyboard mapper works when conditions are not used. Use the enhanced keyboard mapper.
The latching feature (awareness of other range containers) may introduce some strange behaviors and applies to all ranges attached to a single axis, so it's not aware of nesting for example. The latching applies to all ranges in the mapping tree regardless of their level.
Press/Release Container¶
This container simplifies the mapping of actions when an input button is pressed or released. While this can be done with conditions, this is a simpler and easier way to map a button to a set of actions when a button is pressed or released.
Usage tips¶
This container is best used to handle an on/off function (the input only triggers when in one of two possible positions), or a three way function (the input triggers in two out of three positions - the middle position usually being the one that doesn't trigger)
Pressed block¶
In this section, add the container or actions you want to execute on button press. Leave blank for no action.
Release block¶
In this section, add the container of actions you want to execute on button release. Leave blank for no action.
Repeat Container¶
This container mimics keyboard auto-repeat. It allows for actions to be defined that will auto-repeat while the input is triggered (pressed/on). The behavior of the auto-repeat changes with the options selected.
Trigger on Initial Press¶
This option determines if the actions are triggered immediately when the input is pressed. The default is enabled. When enabled, an input press will trigger the repeated actions once, then start the auto-repeat if the input is still pressed after the initial delay lapses. If not enabled, there is no initial trigger of the actions, and the auto-repeat will start only after the initial delay has lapsed. This option has no effect if the initial delay is disabled (set to 0).
Repeat count¶
This is the number of times the actions should repeat while the input is pressed. If set to zero (0), the actions will repeat while the input is pressed indefinitely. If positive, the repeats will stop after the number of repetitions has been reached. This value resets at every input press. The initial trigger is not included in this count. A repeat count of 5 will trigger 6 times if trigger on initial press is enabled, and 5 times if trigger on initial press is disabled.
Initial delay¶
This delay, in milliseconds, is the time between the input is pressed and the time the auto-repeat starts. If this value is disabled (set to 0), the auto-repeat starts immediately on input press.
Repeat hold time¶
This delay, in milliseconds, specifies how long actions are "held", or the time between actions being repeated get a "press" and a "release".
Repeat Interval¶
This delay, in milliseconds, specifies the time between repeats.
Use cases¶
The repeat container can be used to auto-repeat one or more actions when an input is held or while a state is enabled.
The container can also be used to trigger a future action, which only gets executed if the input is still pressed.
TempoEx Container (tempo with chain)¶
This experimental container combines the Tempo and Chain containers together. The container has two main sections, a short press action set, and a long press action set. The delay box indicates how long the (real) button has to be held before selecting either a short or long set.
Each action set contains one or more chain groups.
Each chain group contains one or more actions. A group will execute all the actions in that group.
Chaining means that at every short press, or long press, the container will sequence through the chain groups for that action set in round robin fashion.
The chaining behavior can be prevented if needed (although that's really the point of the container).
The chain delay is included although it will conflict with long press. I may remove it later because the value may be limited in most use-cases that would benefit from this container.
Within each action set, the chain group entries can be re-ordered, or can be removed.
State Device¶
For state creation, expressions, categories, attributes, timed changes, exclusive groups, and state-triggered mappings, follow the State Device User Guide.
For physical input mappings, target selections, pulses, latching, and startup synchronization, follow the companion Map to State User Guide.
State Condition¶
The state condition is used to apply conditional execution on a container or action based on the current value of a state. The condition will prompt for the name of the state, and whether the condition should be pressed or released.
Profile visualization¶
GremlinEx can create a directed graph in PDF or SVG formats of a profile, provided that you have the open source GraphViz library installed. Graphviz will be configured and executed by GremlinEx to produce the relevant files.
The visualizer dialog is accessible from the Tools menu under Tools/Profile Visualization.
WARNING: generated SVG files can be quite large (several megabytes) compared to a PDF file.
GremlinEx currently does not do any pagination of a profile. This can be done if needed with an external application. The purpose of the PDF is not to print, but to visualize the profile graph on a screen using a viewer can can be zoomed in and moved to any location.
User Scripts (plugins)¶
GremlinEx uses Python decorators to facilitate custom scripting and control from Python.
@gremlin.input_devices.gremlin_start¶
Called when a profile is started - lets a script to initialization when a profile starts to run
@gremlin.input_devices.gremlin_stop¶
Called when a profile is stopped - lets a script cleanup when the profile stops running
@gremlin.input_devices.gremlin_mode¶
Called when the mode is changed (use def mode_change(mode) - mode will be a string) - lets a script get a notification when there is a profile mode change somewhere in GremlinEx.
@gremlin.input_devices.gremlin_state¶
Called when the state information is changed (local, remote or broadcast mode). The event properties is_local, is_remote and is_broadcast are flags that contain the current state of GremlinEx.
Recipes¶
One way or two way switch to two way switch / three way switch¶
Some hardware controllers only have a trigger on one (two) positions out of two (three). Usually the center doesn't have a button mapped.
In GremlinEx VjoyRemap a button trigger can easily be output for each position of a switch by adding a release mapping to the hardware positions that do trigger on. The trigger occurs then when the switch leaves the position and turns off.
One responds to button presses on the raw hardware, the other responds to a button release on the raw hardware.
| Mapping | Description |
|---|---|
| Send VJOY output | Sends a button press to VJOY device and button when the position of the button is active. |
| Send VJOY output (on release) | Sends a button press to VJOY device and button when the position of the button is no longer active. The checkbox "execute on release" is selected in this case. |
The equivalent pulse commands can be send to send a momentary pulse rather than having the button on all the time if that is needed.
Long/short press - buttons or keyboard¶
You'll use the tempo container sets up two action blocks, one for short press, the other for long press. The tempo container lets you select a long press delay, so if the input is held long enough, the long action is triggered.
The relevant behaviors of the Vjoyremap action are Button Press, Button Release and Toggle.
Note: this applies to keyboard actions as well, and you can just as easily use this for keyboard presses using the enhanced keyboard action's ability to separate out key presses from key releases.
To setup concurrent button presses (hold the short press while long press is active)¶
In this scenario, both outputs will be active if the input button is held long enough to trigger the long press.
The vjoyremap action in the short action block should be set to button press. The vjoyremap action in the long action block should also be set to button press. The resulting behavior is the short and long buttons will both be pressed if the input button is held long enough, and both will release when the input is released.
| Mapping | Description |
|---|---|
| Short action block | VjoyRemap set to button press and/or MaptoKeyboardEx set to "press" for the output on short hold |
| Long action block | VjoyRemap set to button press and/or MaptoKeyboardEx set to "press" for the output on long hold |
To setup a latched short, then long button press with only one button active¶
In this scenario, either short or long will be active if the input button is held long enough to trigger the long action. If you hold the input long enough, the short button will release, and the long button will stay pressed as long as you hold the input. Only one button will be output at a time.
Add a vjoyremap in the short action block set to button press.
Add two vjoyremaps in the long action block. The first will map to the long press output button and the mode is set to button press.
The second vjoyremap will be set to button release and map to the same output button in the short action block.
| Mapping | Description |
|---|---|
| Short action block | VjoyRemap set to button press and/or MaptoKeyboardEx set to "press" for the output on short hold |
| Long action block | VjoyRemap #1 set to button press and/or MaptoKeyboardEx set to "press" for the output on long hold |
| Long action block | VjoyRemap #2 set to button release and/or MaptoKeyboardEx set to release to release the short press action |
Scripting logic¶
Use conditions, expression states, State containers, or AFCS graphs for logic that can be configured in the profile. For custom algorithms or external APIs, attach a Python user plugin and run functions from hardware events or profile lifecycle callbacks.
Attaching a function to a hardware event¶
You use a Python decorator to map a function to a hardware event. The decorator starts with the @ sign and tells GremlinEx what hardware and input you are mapping to.
GremlinEx adds a Script Generator button to the Device Information dialog that copies all current hardware device names, IDs and automatically creates decorators out of them that can be pasted directly into a Python script file.
Antivirus False Positives¶
GremlinEx uses a well known Python library called PyInstaller to create an EXE from the Python source. Unfortunately some antivirus solutions have been known to flag such executables as potentially harmful.
There is no known solution as the false positive, if it occurs, is unfortunate yet common to python solutions using PyInstaller (Google it) and must be fixed by the scanning software provider. The issue is one of false detection and is not caused by GremlinEx.
Options¶
- You can run it through www.virustotal.com and it will tell you how many malware solutions detect the false positive.
- You can run the code directly from the Python source
You can build the executable yourself using the deploy.bat file in the source folder which is the mechanism I use to build the EXE from source. Unfortunately this doesn't seem to fix the issue for many people even if you are the one building on your own computer.
Workarounds¶
If the false-positive is reported by your scanning solution, consult the recommendations on the PyInstaller project pages. Common suggestions:
- make an exception and mark the GremlinEx .exe as an exception to the scanning (whitelist)
- change your antivirus solution to one that does not have erroneous false-positives
- contact your provider and report the false positive
Some have suggested the code should be signed which could alleviate the issue. However I point out this utility is open source and provided to you free. Its packaging is provided as a convenience. The work is the product of hundreds of development hours, and I am not currently in a position to incur a recurring expense to code sign a free tool in the hope it bypasses the rare false-positive detection, and code signing is not a guarantee. Given the available options and the rarity of the detection, please consider using one of the options above, or just do not use GremlinEx.
Performance¶
GremlinEx is optimized for profile runtime performance. Edit time performance is driven by the complexity of the user interface, specifically the number of device inputs loaded concurrently, and the number of inputs displayed on the input viewer.
Tips to improve design time performance¶
While not always applicable, the tips below will generally help maximize edit time performance and keep memory/CPU usage to a minimum.
Filter inputs¶
Use the input visibility filters to keep the number of displayed inputs manageable. The cost depends on the number of visible controls and the machine; hide unused inputs and devices rather than relying on a fixed input-count limit.
Be particularly mindful of devices with lots of inputs, such as VJOY devices when VJOY is used as input. Use the input filter options to keep the number of inputs to a reasonable level for your machine.
Configure Axis input filtering¶
m77 uses an EMA (exponential moving average) axis filter to smooth noisy input and reduce redundant updates while tracking movement and the final settled position. Tune it with a representative movement test rather than only watching an untouched control.
- Open Options and find Joystick Axis Filter.
- Check Delay (ms), which limits how quickly events are accepted, and Threshold, the minimum movement needed to trigger an update. The tooltips recommend
1 msand0.001respectively as starting values;0disables the corresponding limit. - Observe the axis at rest, make slow small movements, then move it quickly through its range and stop at several positions.
- Adjust the settings only as needed. A larger threshold can suppress noise but also hide intentional small changes. Recheck the destination axis with the profile active.
Use calibration and deadzones to correct center or travel problems. Use visibility filters to hide UI rows. Those controls address different needs from filtering incoming axis events.
Input Viewer for diagnostics / testing only¶
The Input Viewer, while capable, does take a toll on performance proportional to the number of devices shown. The worst offender is the timeline axis view. Consider using Input Viewer only while developping and testing a profile and keep it hidden otherwise. Input Viewer uses resources at profile runtime and design time.
Use states instead of modes where possible¶
Mode context switching is expensive compared to using states. While modes are often needed for more complex profiles, keep mode changes to a minimum where possible, and leverage state conditions over modes as these are faster as they avoid a context switch.
This said, the use of modes itself is not an issue. Aim to avoid constant mode changes in a profile if possible, if an alternative is feasible.
Keep verbose modes to a minimum¶
Verbose modes are helpful to diagnose logic and performance bottlenecks in a profile. Some verbose modes can generate thousands of messages, which are needed to help with profile design and identify potential issues. Once a profile is designed however, verbose modes should be disabled if possible to reduce I/O and overhead associated with generating these messages.
Log files when they get quite large can have a significant impact on performance, even on fast storage devices.
Avoid using VJOY devices as input and output concurrently¶
While GEX allows this configuration, it requies overhead to manage potential conflicts and deadlocks at the VJOY API level that overall can lead to delays. This is another use-case where the GEX State functionality may be preferrable over using VJOY input/output buttons, however it is a supported configuration.
Runnin GremlinEx from source¶
Environment¶
GremlinEx is designed to run from Visual Studio Code.
Python requirements¶
The current m77 build uses 64-bit Python 3.14 and Qt 6/PySide6. Use the Python version and dependencies specified by the checkout and its requirements.txt when setting up a source environment.
Primary entry point¶
Run gremlinEx.py from the repository root using the configured Python environment. It is the primary entry point for a source checkout or a Visual Studio Code launch configuration.
Debug mode caveats¶
Please note that when running GremlinEx from script with a debugger attached, the low level mouse hooks are automatically disabled to prevent interfering with the debugger.
Location of key files¶
The default user data folder is %USERPROFILE%\Joystick Gremlin Ex. Use Actions → Open GremlinEx folder to open the folder used by your configuration, particularly when version-specific storage is enabled. Profiles and external assets can also be stored in locations you choose.
Log file¶
The primary GremlinEx log file is called system.log, which clears at every start. The level of debug data is directly controlled by the verbosity options in GremlinEx options. Warning that selecting most verbosity settings other than the default may result is extremely large log data to be written to the file, and it may significantly impede performance and in particular, mapping response time when a profile is activate. The purpose of the various verbosity settings is to help diagnose specific behaviors with GremlinEx.
The log file will be requested if an issue occurs.
Profile files¶
The profile's XML file stores mappings and states. A companion file with the same base name and a .json extension stores additional profile data, including overlay layouts. Copy both when moving a profile, and include any referenced audio, images, or Python plugins. Use the speech generation and WAV export controls in Play Sound/TTS to prepare audio for the destination machine.
Backups¶
GremlinEx will make an automatic backup of a profile when it is changed. The backup is sequential, stored in the backup folder, and is specific to the version of GremlinEx. This is provided in case a profile is corrupted.
Configuration files¶
GremlinEx stores its configuration to a file called config.json. There is not need to manually edit this file as editing it may cause GremlinEx to not load correctly, or not load at all. If you have a problem with GremlinEx and you think it is related to a configuration setting, make a backup of the config file and delete it so a fresh file is recreated with all defaults on startup.
Limitations¶
Practical profile capacity depends on available CPU, memory, input event rates, and the work performed by mappings and optional modules. Large visible input lists, frequent OCR capture, voice recognition, and complex repeated actions can increase resource use.
Enable the modules you need, filter unused UI inputs, and test the complete profile with representative hardware activity. Use the input viewer and targeted logging to investigate a problem, then close diagnostic views and disable verbose logging when they are no longer needed.


















































