I am trying to make it so that mouse.deltaX only adds information when I press the wiimote button. It works, but Freepie continues to track the gyroscope data and link it to the mouse.delta movements the entire time the script is running. This causes the cursor to jump into existence wherever I am pointing the wiimote and pressing the button. Instead, I want the cursor to track from it's resting spot when the wiimote button was last pressed.
I'm essentially trying to make my wiimote act like a mouse where releasing "A" is similar to lifting a mouse into the air.
Here is the code that I have been working with:
Code: Select all
if wiimote[0].buttons.button_down(WiimoteButtons.A):
mouse.deltaX = filters.deadband(filters.delta(wiimote[0].ahrs.yaw), 0.1) * 25
mouse.deltaY = filters.deadband(filters.delta(wiimote[0].ahrs.pitch), 0.1) * 25