Skip to content

Instantly share code, notes, and snippets.

@WhiteMagic
WhiteMagic / circular_deadzone.py
Created April 12, 2019 11:36
Circular center deadzone with outer border plugin.
import math
import gremlin
from gremlin.user_plugin import *
pa_x = PhysicalInputVariable(
"Physical X Axis",
"Physical X axis input",
[gremlin.common.InputType.JoystickAxis]
@WhiteMagic
WhiteMagic / diff_throttle.py
Created April 9, 2019 12:39
Allows control of a two engine throttle which shifts overall throttle value based on rudder input.
import gremlin
from gremlin.user_plugin import *
# User configurable variables
mode = ModeVariable(
"Mode",
"The mode to use for this mapping"
)
rudder_axis = PhysicalInputVariable(
@WhiteMagic
WhiteMagic / buttons_to_hat.py
Created April 9, 2019 11:41
Allows mapping of four physical buttons to single virtual hat.
import gremlin
from gremlin.user_plugin import *
mode = ModeVariable(
"Mode",
"The mode to use for this mapping"
)
vjoy_hat = VirtualInputVariable(
"Output Hat",
import math
import time
import gremlin
from gremlin.user_plugin import *
mode = ModeVariable("Mode", "The mode in which to use this mapping")
axis = PhysicalInputVariable(
"Input axis",
import math
import time
import gremlin
# Last time the dial was "pressed"
g_last_activation = 0
# How often since last reset the dial was "pressed"
g_activation_count = 0
# Time window within the activation has to happen
import math
import gremlin
# Define all used devices
mt50_l= gremlin.input_devices.JoystickDecorator(
"MT50=DT_L",
gremlin.common.DeviceIdentifier(65740868, 1)
"Default"
)
import gremlin
from vjoy.vjoy import AxisName
hog = gremlin.input_devices.JoystickDecorator(
"Joystick - HOTAS Warthog",
gremlin.common.DeviceIdentifier(72287234, 1),
"Default"
)
# Sensitivity curve setup and deadzone
@WhiteMagic
WhiteMagic / sniper_mode.py
Created December 9, 2018 04:34
Axis sniper mode
import gremlin
from vjoy.vjoy import AxisName
hog = gremlin.input_devices.JoystickDecorator(
"Joystick - HOTAS Warthog",
72287234,
"Default"
)
# Sensitivity curve setup
import gremlin
import math
device = gremlin.input_devices.JoystickDecorator(
"T.16000M",
72331530,
"Default"
)
# Physical axis settings
@WhiteMagic
WhiteMagic / merge_axis.py
Last active February 17, 2019 01:32
Merge two axis
import gremlin
# ---------- Edit between here -----------------------------
# Definition of the first device
device_1 = gremlin.input_devices.JoystickDecorator(
"Joystick - HOTAS Warthog",
gremlin.common.DeviceIdentifier((72287234, 1)
"Default"