I imagine it's something like this:
I got that from another thread, but first, I don't even need to use the Nunchuk and second, it doesn't work because I guess the message Unexpected Token ":"...def wiimoteButtonUpdates:
# A, B buttons
mouse.leftButton = wiimote[0].buttons.button_down(WiimoteButtons.B)
keyboard.setKey( Key.R, wiimote[0].buttons.button_down(WiimoteButtons.A) )
# Dpad controls
keyboard.setKey( Key.D1, wiimote[0].buttons.button_down(WiimoteButtons.DPadUp) )
keyboard.setKey( Key.D2, wiimote[0].buttons.button_down(WiimoteButtons.DPadDown) )
keyboard.setKey( Key.D3, wiimote[0].buttons.button_down(WiimoteButtons.DPadLeft) )
keyboard.setKey( Key.D4, wiimote[0].buttons.button_down(WiimoteButtons.DPadRight) )
# 1,2 buttons
keyboard.setKey( Key.LeftShift, wiimote[0].buttons.button_down(WiimoteButtons.One) )
keyboard.setKey( Key.Q, wiimote[0].buttons.button_down(WiimoteButtons.Two) )
def nunchuckUpdate():
# Nunchuck stick update
y = wiimote[0].nunchuck.stick.y
x = wiimote[0].nunchuck.stick.x
keyboard.setKey(Key.W, (y >= stickDeadZone))
keyboard.setKey(Key.S, (y <= -stickDeaZone))
keyboard.setKey(Key.D, (x >= stickDeadZone))
keyboard.setKey(Key.A, (x <= -stickDeadZone))
# Nuncuck C Z buttons
keyboard.setKey( Key.Space, wiimote[0].nunchuck.buttons.button_down(NunchuckButtons.C) )
keyboard.setKey( Key.E, wiimote[0].nunchuck.buttons.button_down(NunchuckButtons.Z) )
if starting:
system.setThreadTiming(TimingTypes.HighresSystemTimer)
system.threadExecutionInterval = 2
stickDeadZone = 0.20
wiimote[0].buttons.update += wiimoteButtonUpdates
wiimote[0].nunchuck.update += nunchuckUpdate