Skip to content

Instantly share code, notes, and snippets.

@WhiteMagic
Created April 28, 2021 06:23
Show Gist options
  • Save WhiteMagic/b492b620700635463340af2743487a39 to your computer and use it in GitHub Desktop.
Save WhiteMagic/b492b620700635463340af2743487a39 to your computer and use it in GitHub Desktop.
import gremlin
stick = gremlin.input_devices.JoystickDecorator(
"T16000.M",
"4DCB3090-97EC-11EB-8003-444553540000",
"Default"
)
# Create a macro that can be used repeatedly
key_macro = gremlin.macro.Macro()
key_macro.exclusive = False
key_macro.add_action(gremlin.macro.KeyAction(gremlin.macro.key_from_name("A"), True))
key_macro.add_action(gremlin.macro.PauseAction(0.1))
key_macro.add_action(gremlin.macro.KeyAction(gremlin.macro.key_from_name("A"), False))
@stick.button(1)
def axis1(event, vjoy):
if event.is_pressed:
gremlin.macro.MacroManager().queue_macro(key_macro)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment