XOutput Keyboard 2 Axis
Posted: Sat Jul 15, 2017 4:37 pm
Finally, I found the XOutput plugin which give me the possibility to map the keyboard to a virtual axis.
I have this script working:
However, it works only as toggles, or POV switches. Is it possible to tweak it to have incremental values?
I would like to use my NumericPad as a joystick, but without the spring function, something like a second mouse, which do not always return to its center.
Thanks!!!
I have this script working:
Code: Select all
# Mapping keyboard to the axis
# Left
if keyboard.getKeyDown(Key.RightControl) and keyboard.getKeyDown(Key.LeftArrow):
xoutput[0].lx = xoutput[0].AxisMin
# Down
if keyboard.getKeyDown(Key.RightControl) and keyboard.getKeyDown(Key.DownArrow):
xoutput[0].ly = xoutput[0].AxisMin
# Right
if keyboard.getKeyDown(Key.RightControl) and keyboard.getKeyDown(Key.RightArrow):
xoutput[0].lx = xoutput[0].AxisMax
# Up
if keyboard.getKeyDown(Key.RightControl) and keyboard.getKeyDown(Key.UpArrow):
xoutput[0].ly = xoutput[0].AxisMax
# Keyboard Output
vJoy[2].x = xoutput[0].lx
vJoy[2].y = xoutput[0].ly
# keyboard
diagnostics.watch(xoutput[0].lx)
diagnostics.watch(xoutput[0].ly)
diagnostics.watch(vJoy[2].x)
diagnostics.watch(vJoy[2].y)
I would like to use my NumericPad as a joystick, but without the spring function, something like a second mouse, which do not always return to its center.
Thanks!!!