Skip to content

Commit 21ac42f

Browse files
committed
Fixed "Cannot read property ... of undefined"
1 parent 1116434 commit 21ac42f

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

absmouse.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ namespace absmouse {
77
//% shim=absmouse::startAbsoluteMouseService
88
//% weight=50
99
export function startAbsoluteMouseService() : void {
10+
return
1011
}
1112

1213
//% shim=absmouse::_send
1314
function _send(x: number, y: number, buttons: number) : void {
15+
return
1416
}
1517

1618
//% blockId="move absolute mouse xy" block="move absolute mouse | x to $x| and y to $y"
@@ -55,6 +57,7 @@ namespace absmouse {
5557
//% shim=absmouse::setStatusChangeHandler
5658
//% weight=20
5759
export function setStatusChangeHandler(a: Action) {
60+
return
5861
}
5962

6063
//% blockId="absolute mouse enabled" block="absolute mouse enabled" advanced=true

gamepad.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ namespace gamepad {
4444
//% shim=gamepad::startGamepadService
4545
//% weight=50
4646
export function startGamepadService() : void {
47+
return
4748
}
4849

4950
//% shim=gamepad::_send
5051
function _send(buttons: number, xyzrx: number, dpad: number) : void {
52+
return
5153
}
5254

5355

@@ -95,6 +97,7 @@ namespace gamepad {
9597
//% shim=gamepad::setStatusChangeHandler
9698
//% weight=20
9799
export function setStatusChangeHandler(a: Action) {
100+
return
98101
}
99102

100103
//% blockId="gamepad enabled" block="gamepad enabled" advanced=true

keyboard.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,21 @@ namespace keyboard {
3636
//% shim=keyboard::startKeyboardService
3737
//% weight=50
3838
export function startKeyboardService() : void {
39+
return
3940
}
4041

4142
//% blockId="send string" block="send keys | $keys"
4243
//% shim=keyboard::sendString
4344
//% weight=40
4445
export function sendString(keys: string) : void {
46+
return
4547
}
4648

4749
//% blockID="keyboard on status change" block="on keyboard status change" advanced=true
4850
//% shim=keyboard::setStatusChangeHandler
4951
//% weight=20
5052
export function setStatusChangeHandler(a: Action) {
53+
return
5154
}
5255

5356
//% blockId="keyboard enabled" block="keyboard enabled" advanced=true
@@ -152,11 +155,13 @@ namespace keyboard {
152155
//% shim=keyboard::sendSimultaneousKeys
153156
//% weight=50
154157
export function sendSimultaneousKeys(keys: string, hold: boolean) : void {
158+
return
155159
}
156160

157161
//% blockId="release keys" block="release keys" advanced=true
158162
//% shim=keyboard::releaseKeys
159163
//% weight=40
160164
export function releaseKeys() : void {
165+
return
161166
}
162167
}

media.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ namespace media {
2020
//% shim=media::startMediaService
2121
//% weight=50
2222
export function startMediaService() : void {
23+
return
2324
}
2425

2526
//% blockId="send code" block="send code | $code"
2627
//% code.shadow="mediakey_conv"
2728
//% shim=media::sendCode
2829
//% weight=40
2930
export function sendCode(code: number) : void {
31+
return
3032
}
3133

3234
//% blockID="media on status change" block="on media status change" advanced=true
3335
//% shim=media::setStatusChangeHandler
3436
//% weight=20
3537
export function setStatusChangeHandler(a: Action) {
38+
return
3639
}
3740

3841
//% blockId="media enabled" block="media enabled" advanced=true

mouse.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ namespace mouse {
77
//% shim=mouse::startMouseService
88
//% weight=50
99
export function startMouseService() : void {
10+
return
1011
}
1112

1213
//% shim=mouse::_send
1314
function _send(x: number, y: number, scroll: number, buttons: number) : void {
15+
return
1416
}
1517

1618
//% blockId="move mouse xy" block="move mouse | x by $x| and y by $y"
@@ -59,6 +61,7 @@ namespace mouse {
5961
//% shim=mouse::setStatusChangeHandler
6062
//% weight=20
6163
export function setStatusChangeHandler(a: Action) {
64+
return
6265
}
6366

6467
//% blockId="mouse enabled" block="mouse enabled" advanced=true

pxt.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
],
4747
"public": true,
4848
"targetVersions": {
49-
"target": "4.0.16",
49+
"target": "4.0.17",
5050
"targetId": "microbit"
5151
},
5252
"supportedTargets": [

0 commit comments

Comments
 (0)