-
Notifications
You must be signed in to change notification settings - Fork 5
/
tests.ts
28 lines (23 loc) · 839 Bytes
/
tests.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
bluetooth.onBluetoothConnected(() => {
basic.showString("C")
})
bluetooth.onBluetoothDisconnected(() => {
basic.showString("D")
})
bluetooth.startMouseService();
basic.showString("S")
input.onPinPressed(TouchPin.P0, () => {
bluetooth.setMouseButton(MouseButton.MOUSE_BUTTON_LEFT, ButtonState.BUTTON_DOWN)
})
input.onPinReleased(TouchPin.P0, () => {
bluetooth.setMouseButton(MouseButton.MOUSE_BUTTON_LEFT, ButtonState.BUTTON_UP)
})
input.onPinPressed(TouchPin.P1, () => {
bluetooth.setMouseButton(MouseButton.MOUSE_BUTTON_RIGHT, ButtonState.BUTTON_DOWN)
})
input.onPinReleased(TouchPin.P1, () => {
bluetooth.setMouseButton(MouseButton.MOUSE_BUTTON_RIGHT, ButtonState.BUTTON_UP)
})
basic.forever(() => {
bluetooth.setMouseSpeed(input.acceleration(Dimension.X) / 8, input.acceleration(Dimension.Y) / 8, 0)
})