()
| 41 | |
| 42 | |
| 43 | async def run(): |
| 44 | client = TapSDK() |
| 45 | |
| 46 | client.register_disconnection_events(OnDisconnection) |
| 47 | client.register_connection_events(OnConnection) |
| 48 | client.register_air_gesture_events(OnGesture) |
| 49 | client.register_tap_events(OnTapped) |
| 50 | client.register_raw_data_events(OnRawData) |
| 51 | client.register_mouse_events(OnMoused) |
| 52 | client.register_air_gesture_state_events(OnMouseModeChange) |
| 53 | await client.run() |
| 54 | logger.info("Connected: %s", client.client.is_connected) |
| 55 | |
| 56 | logger.info("Set Controller Mode for 5 seconds") |
| 57 | await client.set_input_mode(im.InputModeController()) |
| 58 | await asyncio.sleep(5) |
| 59 | |
| 60 | logger.info("Force Mouse Mode for 5 seconds") |
| 61 | await client.set_input_type(InputType.MOUSE) |
| 62 | await asyncio.sleep(5) |
| 63 | |
| 64 | logger.info("Force keyboard Mode for 5 seconds") |
| 65 | await client.set_input_type(InputType.KEYBOARD) |
| 66 | await asyncio.sleep(5) |
| 67 | |
| 68 | logger.info("Set auto Mode for 10 seconds") |
| 69 | await client.set_input_type(InputType.AUTO) |
| 70 | await asyncio.sleep(10) |
| 71 | |
| 72 | logger.info("Set Text Mode for 10 seconds") |
| 73 | await client.set_input_mode(im.InputModeText()) |
| 74 | await asyncio.sleep(10) |
| 75 | |
| 76 | logger.info("Send Haptics") |
| 77 | await client.send_vibration_sequence([100, 200, 100, 200, 500]) |
| 78 | await asyncio.sleep(5) |
| 79 | |
| 80 | logger.info("Set Raw Mode for 5 seconds") |
| 81 | await asyncio.sleep(2) |
| 82 | await client.set_input_mode(im.InputModeRaw(finger_accl_sens=FingerAcclSensitivity.G16, |
| 83 | imu_gyro_sens=ImuGyroSensitivity.DPS500, |
| 84 | imu_accl_sens=ImuAcclSensitivity.G4, |
| 85 | scaled=True)) |
| 86 | await asyncio.sleep(5) |
| 87 | |
| 88 | |
| 89 | if __name__ == "__main__": |
no test coverage detected