Created
June 20, 2016 09:08
-
-
Save WhiteMagic/aa577f707d78abf2fd78f6d6f0f814eb 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 time | |
import threading | |
import gremlin | |
from vjoy.vjoy import AxisName | |
# Implement using recurring timer | |
def slider_update_timer(): | |
vjoy = gremlin.input_devices.VJoyProxy() | |
joy = gremlin.input_devices.JoystickProxy() | |
vjoy[1].axis[AxisName.SL0].value = joy[3].axis(4) | |
threading.Timer(1, slider_update_timer).start() | |
#slider_update_timer() | |
# Implement via sleeping thread | |
def slider_update_thread(): | |
vjoy = gremlin.input_devices.VJoyProxy() | |
joy = gremlin.input_devices.JoystickProxy() | |
while True: | |
vjoy[1].axis[AxisName.SL0].value = joy[3].axis(4) | |
time.sleep(0.5) | |
t = threading.Thread(target=slider_update_thread).start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment