Created
June 24, 2016 21:38
-
-
Save papodaca/e1c66d10d3922a31beeed3c3544be116 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
def update(): | |
## BUTTONS ## | |
vJoy[1].setButton(0, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.A)) | |
vJoy[1].setButton(1, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.B)) | |
vJoy[1].setButton(2, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.X)) | |
vJoy[1].setButton(3, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.Y)) | |
vJoy[1].setButton(4, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.DPadDown)) | |
vJoy[1].setButton(5, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.DPadLeft)) | |
vJoy[1].setButton(6, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.DPadRight)) | |
vJoy[1].setButton(7, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.DPadUp)) | |
vJoy[1].setButton(8, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.Plus)) | |
vJoy[1].setButton(9, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.Minus)) | |
vJoy[1].setButton(10, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.Home)) | |
vJoy[1].setButton(11, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.ZLeft)) | |
vJoy[1].setButton(12, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.ZRight)) | |
vJoy[1].setButton(13, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.TriggerLeft)) | |
vJoy[1].setButton(14, wiimote[0].classic_controller.buttons.button_down(ClassicControllerButtons.TriggerRight)) | |
## ANALOG STICKS ## | |
vJoyMax = vJoy[1].axisMax | |
vJoy[1].x = (wiimote[0].classic_controller.leftStick.x / 30) * vJoyMax | |
vJoy[1].y = -(wiimote[0].classic_controller.leftStick.y / 30) * vJoyMax | |
vJoy[1].rx = (wiimote[0].classic_controller.rightStick.x / 13) * vJoyMax | |
vJoy[1].ry = (wiimote[0].classic_controller.rightStick.y / 13) * vJoyMax | |
## TRIGGERS ## | |
triggerMax=27 | |
vJoy[1].dial = ((wiimote[0].classic_controller.rightTrigger.x / (triggerMax / 2)) * vJoyMax) - vJoyMax | |
vJoy[1].slider = ((wiimote[0].classic_controller.leftTrigger.x / (triggerMax / 2)) * vJoyMax) - vJoyMax | |
if starting: | |
wiimote[0].enable(WiimoteCapabilities.Extension) | |
wiimote[0].classic_controller.update += update | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment