2.8 KiB
Axis to Scrollwheel - a plugin for Joystick Gremlin
This is a plugin for Joystick Gremlin (JG). Familiarity with JG is assumed.
This script will allow you to configure a joystick axis to send mouse scrollwheel events. The scrollwheel will move faster when the axis is farther from zero. A centered axis is assumed; a single-directional axis (like some throttles, sliders, etc) will only be able to scroll in one direction.
The motivating use case for this plugin is ship tractor beams in the game Star Citizen; tuning defaults are configured with this in mind.
Installation
- Download the latest release (the file labeled
Source Code (ZIP)
) from the releases page. - Extract the zip file somewhere.
- Click "Add Plugin" on the Plugins tab of Joystick Gremlin.
- Navigate to the axis_to_scrollwheel.py file you just extracted and select it.
Configuration
Clicking on the gear icon next to the plugin in the plugin list will present you with several configuration options. You need to toggle the profile off and on again for changes to take effect.
Axis
The axis that should act as a scrollwheel.
Mode
The plugin will only change the axis behavior when in the selected Mode. If you aren't using Modes (or don't know what they are) the default value should work correctly.
Scroll Speed
Increasing this value will cause the scroll wheel to scroll more quickly. 1.0 is a good default. If scrolling feels too fast to you, try changing this to 0.5.
Note that this value cannot be zero; if it is set to zero it will be automatically changed to 1.0.
Deadzone
This deadzone will take precedence over any deadzone already configured in Joystick Gremlin. 1.0 represents the joystick's entire range. 0.0 represents no deadzone.
Invert
If the scrolling feels backwards, select this.
Known Issues
- The Scroll Speed always gets assigned a default value of
0.0
, due to a bug in Joystick Gremlin. For this reason0.0
is always treated as1.0
. - Maxing out the axis in either direction will cause the scrolling to stop. This is a limitation of Joystick Gremlin; it stops producing joystick axis events in this case. Ideally we could use a periodic check instead of responding to axis events, but periodic callbacks are currently broken.
- Any other binds in Joystick Gremlin for this axis will still be executed. A major future improvement is to make the plugin's behavior a first-order action in Joystick Gremlin (i.e., you'd be able to select it where you would normally choose "Remap") but that functionality is not well documented.