Created
February 20, 2017 07:24
-
-
Save WhiteMagic/2164619026dbe412bed074e9a8129765 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gremlin | |
t16000 = gremlin.input_devices.JoystickDecorator( | |
"T.16000M", | |
72331530, | |
"Default" | |
) | |
g_last_axis_value = 0.0 | |
increase = gremlin.input_devices.macro.Macro() | |
#increase.tap("=") | |
increase.tap(gremlin.input_devices.macro.Keys.KPPlus) | |
decrease = gremlin.input_devices.macro.Macro() | |
#decrease.tap("-") | |
decrease.tap(gremlin.input_devices.macro.Keys.KPMinus) | |
@t16000.axis(4) | |
def axis_motion(event): | |
global g_last_axis_value | |
cur_value = event.value | |
if cur_value > g_last_axis_value: | |
increase.run() | |
elif cur_value < g_last_axis_value: | |
decrease.run() | |
g_last_axis_value = cur_value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment