Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
9f1adc9aa3 | |||
e4a78b7566 | |||
870f3bfe99 |
|
@ -37,9 +37,6 @@ invert = BoolVariable(
|
||||||
# Constants
|
# Constants
|
||||||
AXIS_SCALING_FACTOR = 250 # Value determined through testing.
|
AXIS_SCALING_FACTOR = 250 # Value determined through testing.
|
||||||
|
|
||||||
# Debugging
|
|
||||||
ticks = 0
|
|
||||||
|
|
||||||
axis_decorator = axis.create_decorator(mode.value)
|
axis_decorator = axis.create_decorator(mode.value)
|
||||||
last_timestamp = datetime.now()
|
last_timestamp = datetime.now()
|
||||||
scroll_scaling = scroll_speed.value if scroll_speed.value != 0.0 else 1.0
|
scroll_scaling = scroll_speed.value if scroll_speed.value != 0.0 else 1.0
|
||||||
|
@ -50,7 +47,6 @@ scroll_scaling = scroll_speed.value if scroll_speed.value != 0.0 else 1.0
|
||||||
def handle_axis(event):
|
def handle_axis(event):
|
||||||
global last_timestamp
|
global last_timestamp
|
||||||
global damping
|
global damping
|
||||||
global ticks # debug
|
|
||||||
|
|
||||||
# TODO: use this code instead when periodic callback is fixed
|
# TODO: use this code instead when periodic callback is fixed
|
||||||
# axis_value = joy[axis.device_guid].axis(axis.input_id).value
|
# axis_value = joy[axis.device_guid].axis(axis.input_id).value
|
||||||
|
@ -67,7 +63,3 @@ def handle_axis(event):
|
||||||
if invert.value: direction = direction * -1
|
if invert.value: direction = direction * -1
|
||||||
gremlin.sendinput.mouse_wheel(direction)
|
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
|
## Installation
|
||||||
|
|
||||||
* Download the latest release from the [releases page](https://git.annabunches.net/annabunches/joystick_gremlin_axis_to_scrollwheel/releases).
|
* 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).
|
||||||
* Extract the zip file somewhere.
|
* Extract the zip file somewhere.
|
||||||
* Click "Add Plugin" on the Plugins tab of Joystick Gremlin.
|
* Click "Add Plugin" on the Plugins tab of Joystick Gremlin.
|
||||||
* Navigate to the axis_to_scrollwheel.py file you just extracted and select it.
|
* Navigate to the axis_to_scrollwheel.py file you just extracted and select it.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user