Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save WhiteMagic/aa577f707d78abf2fd78f6d6f0f814eb to your computer and use it in GitHub Desktop.
Save WhiteMagic/aa577f707d78abf2fd78f6d6f0f814eb to your computer and use it in GitHub Desktop.
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