Compare commits
No commits in common. "main" and "v0.1" have entirely different histories.
|
@ -37,6 +37,9 @@ invert = BoolVariable(
|
|||
# Constants
|
||||
AXIS_SCALING_FACTOR = 250 # Value determined through testing.
|
||||
|
||||
# Debugging
|
||||
ticks = 0
|
||||
|
||||
axis_decorator = axis.create_decorator(mode.value)
|
||||
last_timestamp = datetime.now()
|
||||
scroll_scaling = scroll_speed.value if scroll_speed.value != 0.0 else 1.0
|
||||
|
@ -47,6 +50,7 @@ scroll_scaling = scroll_speed.value if scroll_speed.value != 0.0 else 1.0
|
|||
def handle_axis(event):
|
||||
global last_timestamp
|
||||
global damping
|
||||
global ticks # debug
|
||||
|
||||
# TODO: use this code instead when periodic callback is fixed
|
||||
# axis_value = joy[axis.device_guid].axis(axis.input_id).value
|
||||
|
@ -62,4 +66,8 @@ def handle_axis(event):
|
|||
direction = 1 if axis_value > 0 else -1
|
||||
if invert.value: direction = direction * -1
|
||||
gremlin.sendinput.mouse_wheel(direction)
|
||||
last_timestamp = datetime.now()
|
||||
last_timestamp = datetime.now()
|
||||
|
||||
# debug
|
||||
ticks += 1
|
||||
gremlin.util.log(ticks)
|
|
@ -8,7 +8,7 @@ The motivating use case for this plugin is ship tractor beams in the game [Star
|
|||
|
||||
## Installation
|
||||
|
||||
* Download the latest release (the file labeled `Source Code (ZIP)`) from the [releases page](https://git.annabunches.net/annabunches/joystick_gremlin_axis_to_scrollwheel/releases).
|
||||
* Download the latest release from the [releases page](https://git.annabunches.net/annabunches/joystick_gremlin_axis_to_scrollwheel/releases).
|
||||
* 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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user