pxt-microbit 7.1.36 → 7.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/built/block-tests.js +1 -1
- package/built/hexcache/{09c1ed868d7d8b474313e6abc88c7a9bede0ca376a507a97886137e8d91372e9.hex → 986702a417fa55a0e1b078a6d7403b3498bc795834f771651ebc340080a116d1.hex} +4766 -4766
- package/built/hexcache/{ba843ecd090c93546c91118ee212273e7b1e104915bfd9146cb18fa1a1c826a6.hex → d8cab56e73d9451077691022c34b835c5bbdbe6b561106a2812f7964c11125c7.hex} +4249 -4249
- package/built/sim.d.ts +1 -0
- package/built/sim.js +108 -43
- package/built/target.js +1 -1
- package/built/target.json +1 -1
- package/built/targetlight.js +1 -1
- package/built/targetlight.json +1 -1
- package/built/theme.json +1 -1
- package/built/web/blockly.css +1 -1
- package/built/web/react-common-authcode.css +1 -1
- package/built/web/react-common-multiplayer.css +1 -1
- package/built/web/react-common-skillmap.css +1 -1
- package/built/web/rtlblockly.css +1 -1
- package/built/web/rtlreact-common-authcode.css +1 -1
- package/built/web/rtlreact-common-multiplayer.css +1 -1
- package/built/web/rtlreact-common-skillmap.css +1 -1
- package/built/web/rtlsemantic.css +1 -1
- package/built/web/semantic.css +1 -1
- package/package.json +4 -10
- package/pxtarget.json +1 -0
- package/sim/public/simulator.html +6 -1
- /package/built/hexcache/{0ddbecb007986045d0daa6818b319bdc1d05397d2b57d117798c64695cdc9d23.hex → 3858c1af7a919520536cd0945353c09f5d6651f5364aac72bddd143022164eca.hex} +0 -0
- /package/built/hexcache/{01fcf2f97a9eaeefd82a2ddaa0ca451b2500ff47b8dc92db69fda37deeb1b910.hex → 8282abaaf754219aa67b07053567547dda2179a2888d75791d2cd9b66bf8e531.hex} +0 -0
package/built/sim.d.ts
CHANGED
|
@@ -891,6 +891,7 @@ declare namespace pxsim.visuals {
|
|
|
891
891
|
private attachABEvents;
|
|
892
892
|
attachButtonEvents(stateButton: Button, buttonOuter: SVGElement, elButton: SVGElement): void;
|
|
893
893
|
private attachAPlusBEvents;
|
|
894
|
+
private attachKeyboardEvents;
|
|
894
895
|
}
|
|
895
896
|
}
|
|
896
897
|
declare namespace pxsim {
|
package/built/sim.js
CHANGED
|
@@ -132,12 +132,12 @@ var pxsim;
|
|
|
132
132
|
highContrast: msg.highContrast
|
|
133
133
|
}), opts);
|
|
134
134
|
document.body.innerHTML = ""; // clear children
|
|
135
|
-
document.body.appendChild(this.view = this.viewHost.getView());
|
|
136
135
|
if (pxsim.shouldShowMute()) {
|
|
137
136
|
document.body.appendChild(pxsim.createMuteButton());
|
|
138
137
|
pxsim.AudioContextManager.mute(true);
|
|
139
138
|
pxsim.setParentMuteState("disabled");
|
|
140
139
|
}
|
|
140
|
+
document.body.appendChild(this.view = this.viewHost.getView());
|
|
141
141
|
if (msg.theme === "mbcodal") {
|
|
142
142
|
this.ensureHardwareVersion(2);
|
|
143
143
|
}
|
|
@@ -3984,8 +3984,8 @@ var pxsim;
|
|
|
3984
3984
|
stroke-width:2px;
|
|
3985
3985
|
}
|
|
3986
3986
|
|
|
3987
|
-
.sim-pin-touch.touched
|
|
3988
|
-
stroke:darkorange;
|
|
3987
|
+
.sim-pin-touch.touched {
|
|
3988
|
+
stroke:darkorange !important;
|
|
3989
3989
|
}
|
|
3990
3990
|
|
|
3991
3991
|
.sim-led-back:hover {
|
|
@@ -4088,17 +4088,26 @@ var pxsim;
|
|
|
4088
4088
|
outline: none;
|
|
4089
4089
|
}
|
|
4090
4090
|
*:focus .sim-button-outer,
|
|
4091
|
-
.sim-antenna-outer:focus,
|
|
4092
|
-
.sim-pin:focus,
|
|
4093
|
-
.sim-thermometer:focus,
|
|
4094
4091
|
.sim-shake:focus,
|
|
4095
|
-
.sim-
|
|
4096
|
-
|
|
4097
|
-
stroke
|
|
4092
|
+
.sim-thermometer:focus {
|
|
4093
|
+
outline: 5px solid white;
|
|
4094
|
+
stroke: black;
|
|
4095
|
+
stroke-width: 10px;
|
|
4096
|
+
paint-order: stroke;
|
|
4098
4097
|
}
|
|
4099
4098
|
.sim-button-outer.sim-button-group:focus > .sim-button {
|
|
4100
|
-
|
|
4101
|
-
stroke
|
|
4099
|
+
outline: 5px solid white;
|
|
4100
|
+
stroke: black;
|
|
4101
|
+
stroke-width: 5px;
|
|
4102
|
+
paint-order: stroke;
|
|
4103
|
+
}
|
|
4104
|
+
.sim-light-level-button:focus,
|
|
4105
|
+
.sim-antenna-outer:focus > .sim-antenna {
|
|
4106
|
+
outline: 5px solid white;
|
|
4107
|
+
}
|
|
4108
|
+
.sim-pin:focus {
|
|
4109
|
+
stroke: white;
|
|
4110
|
+
stroke-width: 5px !important;
|
|
4102
4111
|
}
|
|
4103
4112
|
.no-drag, .sim-text, .sim-text-small,
|
|
4104
4113
|
.sim-text-pin {
|
|
@@ -4332,12 +4341,12 @@ path.sim-board {
|
|
|
4332
4341
|
}
|
|
4333
4342
|
updateButtonPairs() {
|
|
4334
4343
|
const state = this.board;
|
|
4335
|
-
const
|
|
4336
|
-
const
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4344
|
+
const { buttonDown, buttonUp, virtualButtonUp } = this.props.theme;
|
|
4345
|
+
const { aBtn, bBtn, abBtn } = state.buttonPairState;
|
|
4346
|
+
pxsim.svg.fill(this.buttons[0], aBtn.pressed ? buttonDown : buttonUp);
|
|
4347
|
+
pxsim.svg.fill(this.buttons[1], bBtn.pressed ? buttonDown : buttonUp);
|
|
4348
|
+
pxsim.svg.fill(this.buttons[2], abBtn.pressed ? buttonDown : virtualButtonUp);
|
|
4349
|
+
pxsim.svg.fill(this.headParts, state.logoTouch.pressed ? buttonDown : buttonUp);
|
|
4341
4350
|
}
|
|
4342
4351
|
updateLEDMatrix() {
|
|
4343
4352
|
const state = this.board;
|
|
@@ -4386,7 +4395,10 @@ path.sim-board {
|
|
|
4386
4395
|
pxsim.svg.fill(this.shakeButton, this.props.theme.virtualButtonUp);
|
|
4387
4396
|
this.board.accelerometerState.shake();
|
|
4388
4397
|
});
|
|
4389
|
-
pxsim.accessibility.enableKeyboardInteraction(this.shakeButton,
|
|
4398
|
+
pxsim.accessibility.enableKeyboardInteraction(this.shakeButton, () => {
|
|
4399
|
+
pxsim.svg.fill(this.shakeButton, this.props.theme.buttonDown);
|
|
4400
|
+
}, () => {
|
|
4401
|
+
pxsim.svg.fill(this.shakeButton, this.props.theme.virtualButtonUp);
|
|
4390
4402
|
this.board.accelerometerState.shake();
|
|
4391
4403
|
});
|
|
4392
4404
|
pxsim.accessibility.setAria(this.shakeButton, "button", "Shake the board");
|
|
@@ -4595,12 +4607,40 @@ path.sim-board {
|
|
|
4595
4607
|
p.setAttribute("d", "m269.9,50.134647l0,0l-39.5,0l0,0c-14.1,0.1 -24.6,10.7 -24.6,24.8c0,13.9 10.4,24.4 24.3,24.7l0,0l39.6,0c14.2,0 40.36034,-22.97069 40.36034,-24.85394c0,-1.88326 -26.06034,-24.54606 -40.16034,-24.64606m-0.2,39l0,0l-39.3,0c-7.7,-0.1 -14,-6.4 -14,-14.2c0,-7.8 6.4,-14.2 14.2,-14.2l39.1,0c7.8,0 14.2,6.4 14.2,14.2c0,7.9 -6.4,14.2 -14.2,14.2l0,0l0,0z");
|
|
4596
4608
|
this.updateTheme();
|
|
4597
4609
|
let pt = this.element.createSVGPoint();
|
|
4598
|
-
pxsim.svg.buttonEvents(this.head,
|
|
4610
|
+
pxsim.svg.buttonEvents(this.head,
|
|
4611
|
+
// move
|
|
4612
|
+
(ev) => {
|
|
4599
4613
|
let cur = pxsim.svg.cursorPoint(pt, this.element, ev);
|
|
4600
4614
|
state.compassState.heading = Math.floor(Math.atan2(cur.y - yc, cur.x - xc) * 180 / Math.PI) + 90;
|
|
4601
4615
|
if (state.compassState.heading < 0)
|
|
4602
4616
|
state.compassState.heading += 360;
|
|
4603
4617
|
this.updateHeading();
|
|
4618
|
+
},
|
|
4619
|
+
// start
|
|
4620
|
+
ev => { },
|
|
4621
|
+
// stop
|
|
4622
|
+
ev => { },
|
|
4623
|
+
// keydown
|
|
4624
|
+
(ev) => {
|
|
4625
|
+
let charCode = (typeof ev.which == "number") ? ev.which : ev.keyCode;
|
|
4626
|
+
if (charCode === 40 || charCode === 37) { // Down/Left arrow
|
|
4627
|
+
ev.preventDefault();
|
|
4628
|
+
state.compassState.heading--;
|
|
4629
|
+
if (state.compassState.heading < 0)
|
|
4630
|
+
state.compassState.heading += 360;
|
|
4631
|
+
if (state.compassState.heading >= 360)
|
|
4632
|
+
state.compassState.heading %= 360;
|
|
4633
|
+
this.updateHeading();
|
|
4634
|
+
}
|
|
4635
|
+
else if (charCode === 38 || charCode === 39) { // Up/Right arrow
|
|
4636
|
+
ev.preventDefault();
|
|
4637
|
+
state.compassState.heading++;
|
|
4638
|
+
if (state.compassState.heading < 0)
|
|
4639
|
+
state.compassState.heading += 360;
|
|
4640
|
+
if (state.compassState.heading >= 360)
|
|
4641
|
+
state.compassState.heading %= 360;
|
|
4642
|
+
this.updateHeading();
|
|
4643
|
+
}
|
|
4604
4644
|
});
|
|
4605
4645
|
this.headInitialized = true;
|
|
4606
4646
|
}
|
|
@@ -4611,6 +4651,9 @@ path.sim-board {
|
|
|
4611
4651
|
if (this.props.runtime)
|
|
4612
4652
|
this.props.runtime.environmentGlobals[pxsim.localization.lf("heading")] = state.compassState.heading;
|
|
4613
4653
|
}
|
|
4654
|
+
// make sim head focusable when there is a compass
|
|
4655
|
+
this.headParts.setAttribute("class", "sim-button-outer sim-button-group");
|
|
4656
|
+
pxsim.accessibility.makeFocusable(this.headParts);
|
|
4614
4657
|
}
|
|
4615
4658
|
flashSystemLed() {
|
|
4616
4659
|
if (!this.systemLed)
|
|
@@ -4995,6 +5038,14 @@ path.sim-board {
|
|
|
4995
5038
|
return lg;
|
|
4996
5039
|
});
|
|
4997
5040
|
this.pinTexts = [67, 165, 275].map(x => pxsim.svg.child(this.g, "text", { class: "sim-text-pin", x: x, y: 345 }));
|
|
5041
|
+
pxsim.svg.path(this.g, "sim-label", "M35.7,376.4c0-2.8,2.1-5.1,5.5-5.1c3.3,0,5.5,2.4,5.5,5.1v4.7c0,2.8-2.2,5.1-5.5,5.1c-3.3,0-5.5-2.4-5.5-5.1V376.4zM43.3,376.4c0-1.3-0.8-2.3-2.2-2.3c-1.3,0-2.1,1.1-2.1,2.3v4.7c0,1.2,0.8,2.3,2.1,2.3c1.3,0,2.2-1.1,2.2-2.3V376.4z");
|
|
5042
|
+
pxsim.svg.path(this.g, "sim-label", "M136.2,374.1c2.8,0,3.4-0.8,3.4-2.5h2.9v14.3h-3.4v-9.5h-3V374.1z");
|
|
5043
|
+
pxsim.svg.path(this.g, "sim-label", "M248.6,378.5c1.7-1,3-1.7,3-3.1c0-1.1-0.7-1.6-1.6-1.6c-1,0-1.8,0.6-1.8,2.1h-3.3c0-2.6,1.8-4.6,5.1-4.6c2.6,0,4.9,1.3,4.9,4.3c0,2.4-2.3,3.9-3.8,4.7c-2,1.3-2.5,1.8-2.5,2.9h6.1v2.7h-10C244.8,381.2,246.4,379.9,248.6,378.5z");
|
|
5044
|
+
pxsim.svg.path(this.g, "sim-label", "M352.1,381.1c0,1.6,0.9,2.5,2.2,2.5c1.2,0,1.9-0.9,1.9-1.9c0-1.2-0.6-2-2.1-2h-1.3v-2.6h1.3c1.5,0,1.9-0.7,1.9-1.8c0-1.1-0.7-1.6-1.6-1.6c-1.4,0-1.8,0.8-1.8,2.1h-3.3c0-2.4,1.5-4.6,5.1-4.6c2.6,0,5,1.3,5,4c0,1.6-1,2.8-2.1,3.2c1.3,0.5,2.3,1.6,2.3,3.5c0,2.7-2.4,4.3-5.2,4.3c-3.5,0-5.5-2.1-5.5-5.1H352.1z");
|
|
5045
|
+
pxsim.svg.path(this.g, "sim-label", "M368.5,385.9h-3.1l-5.1-14.3h3.5l3.1,10.1l3.1-10.1h3.6L368.5,385.9z");
|
|
5046
|
+
pxsim.svg.path(this.g, "sim-label", "M444.4,378.3h7.4v2.5h-1.5c-0.6,3.3-3,5.5-7.1,5.5c-4.8,0-7.5-3.5-7.5-7.5c0-3.9,2.8-7.5,7.5-7.5c3.8,0,6.4,2.3,6.6,5h-3.5c-0.2-1.1-1.4-2.2-3.1-2.2c-2.7,0-4.1,2.3-4.1,4.7c0,2.5,1.4,4.7,4.4,4.7c2,0,3.2-1.2,3.4-2.7h-2.5V378.3z");
|
|
5047
|
+
pxsim.svg.path(this.g, "sim-label", "M461.4,380.9v-9.3h3.3v14.3h-3.5l-5.2-9.2v9.2h-3.3v-14.3h3.5L461.4,380.9z");
|
|
5048
|
+
pxsim.svg.path(this.g, "sim-label", "M472.7,371.6c4.8,0,7.5,3.5,7.5,7.2s-2.7,7.2-7.5,7.2h-5.3v-14.3H472.7z M470.8,374.4v8.6h1.8c2.7,0,4.2-2.1,4.2-4.3s-1.6-4.3-4.2-4.3H470.8z");
|
|
4998
5049
|
}
|
|
4999
5050
|
buildShakeElement() {
|
|
5000
5051
|
this.shakeButton = pxsim.svg.child(this.g, "circle", {
|
|
@@ -5032,16 +5083,8 @@ path.sim-board {
|
|
|
5032
5083
|
this.buttonsOuter[2].style.visibility = "hidden";
|
|
5033
5084
|
this.buttons[2].style.visibility = "hidden";
|
|
5034
5085
|
this.buttons.forEach(btn => pxsim.svg.hydrate(btn, { fill: "#111" }));
|
|
5035
|
-
pxsim.svg.path(this.g, "sim-label", "M35.7,376.4c0-2.8,2.1-5.1,5.5-5.1c3.3,0,5.5,2.4,5.5,5.1v4.7c0,2.8-2.2,5.1-5.5,5.1c-3.3,0-5.5-2.4-5.5-5.1V376.4zM43.3,376.4c0-1.3-0.8-2.3-2.2-2.3c-1.3,0-2.1,1.1-2.1,2.3v4.7c0,1.2,0.8,2.3,2.1,2.3c1.3,0,2.2-1.1,2.2-2.3V376.4z");
|
|
5036
|
-
pxsim.svg.path(this.g, "sim-label", "M136.2,374.1c2.8,0,3.4-0.8,3.4-2.5h2.9v14.3h-3.4v-9.5h-3V374.1z");
|
|
5037
|
-
pxsim.svg.path(this.g, "sim-label", "M248.6,378.5c1.7-1,3-1.7,3-3.1c0-1.1-0.7-1.6-1.6-1.6c-1,0-1.8,0.6-1.8,2.1h-3.3c0-2.6,1.8-4.6,5.1-4.6c2.6,0,4.9,1.3,4.9,4.3c0,2.4-2.3,3.9-3.8,4.7c-2,1.3-2.5,1.8-2.5,2.9h6.1v2.7h-10C244.8,381.2,246.4,379.9,248.6,378.5z");
|
|
5038
5086
|
pxsim.svg.path(this.g, "sim-button-label", "M48.1,270.9l-0.6-1.7h-5.1l-0.6,1.7h-3.5l5.1-14.3h3.1l5.2,14.3H48.1z M45,260.7l-1.8,5.9h3.5L45,260.7z");
|
|
5039
5087
|
pxsim.svg.path(this.g, "sim-button-label", "M449.1,135.8h5.9c3.9,0,4.7,2.4,4.7,3.9c0,1.8-1.4,2.9-2.5,3.2c0.9,0,2.6,1.1,2.6,3.3c0,1.5-0.8,4-4.7,4h-6V135.8zM454.4,141.7c1.6,0,2-1,2-1.7c0-0.6-0.3-1.7-2-1.7h-2v3.4H454.4z M452.4,144.1v3.5h2.1c1.6,0,2-1,2-1.8c0-0.7-0.4-1.8-2-1.8H452.4z");
|
|
5040
|
-
pxsim.svg.path(this.g, "sim-label", "M352.1,381.1c0,1.6,0.9,2.5,2.2,2.5c1.2,0,1.9-0.9,1.9-1.9c0-1.2-0.6-2-2.1-2h-1.3v-2.6h1.3c1.5,0,1.9-0.7,1.9-1.8c0-1.1-0.7-1.6-1.6-1.6c-1.4,0-1.8,0.8-1.8,2.1h-3.3c0-2.4,1.5-4.6,5.1-4.6c2.6,0,5,1.3,5,4c0,1.6-1,2.8-2.1,3.2c1.3,0.5,2.3,1.6,2.3,3.5c0,2.7-2.4,4.3-5.2,4.3c-3.5,0-5.5-2.1-5.5-5.1H352.1z");
|
|
5041
|
-
pxsim.svg.path(this.g, "sim-label", "M368.5,385.9h-3.1l-5.1-14.3h3.5l3.1,10.1l3.1-10.1h3.6L368.5,385.9z");
|
|
5042
|
-
pxsim.svg.path(this.g, "sim-label", "M444.4,378.3h7.4v2.5h-1.5c-0.6,3.3-3,5.5-7.1,5.5c-4.8,0-7.5-3.5-7.5-7.5c0-3.9,2.8-7.5,7.5-7.5c3.8,0,6.4,2.3,6.6,5h-3.5c-0.2-1.1-1.4-2.2-3.1-2.2c-2.7,0-4.1,2.3-4.1,4.7c0,2.5,1.4,4.7,4.4,4.7c2,0,3.2-1.2,3.4-2.7h-2.5V378.3z");
|
|
5043
|
-
pxsim.svg.path(this.g, "sim-label", "M461.4,380.9v-9.3h3.3v14.3h-3.5l-5.2-9.2v9.2h-3.3v-14.3h3.5L461.4,380.9z");
|
|
5044
|
-
pxsim.svg.path(this.g, "sim-label", "M472.7,371.6c4.8,0,7.5,3.5,7.5,7.2s-2.7,7.2-7.5,7.2h-5.3v-14.3H472.7z M470.8,374.4v8.6h1.8c2.7,0,4.2-2.1,4.2-4.3s-1.6-4.3-4.2-4.3H470.8z");
|
|
5045
5088
|
}
|
|
5046
5089
|
updateHardwareVersion() {
|
|
5047
5090
|
// check if microphone has been used
|
|
@@ -5119,6 +5162,7 @@ path.sim-board {
|
|
|
5119
5162
|
this.attachPinsTouchEvents();
|
|
5120
5163
|
this.attachABEvents();
|
|
5121
5164
|
this.attachAPlusBEvents();
|
|
5165
|
+
this.attachKeyboardEvents();
|
|
5122
5166
|
}
|
|
5123
5167
|
attachIFrameEvents() {
|
|
5124
5168
|
pxsim.Runtime.messagePosted = (msg) => {
|
|
@@ -5274,9 +5318,19 @@ path.sim-board {
|
|
|
5274
5318
|
this.board.bus.queue(state.edgeConnectorState.pins[index].id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
|
|
5275
5319
|
pressedTime = undefined;
|
|
5276
5320
|
});
|
|
5277
|
-
pxsim.accessibility.enableKeyboardInteraction(btn,
|
|
5321
|
+
pxsim.accessibility.enableKeyboardInteraction(btn, () => {
|
|
5278
5322
|
let state = this.board;
|
|
5323
|
+
state.edgeConnectorState.pins[index].touched = true;
|
|
5324
|
+
let svgpin = this.pins[index];
|
|
5325
|
+
pxsim.U.addClass(svgpin, "touched");
|
|
5326
|
+
this.updatePin(state.edgeConnectorState.pins[index], index);
|
|
5279
5327
|
this.board.bus.queue(state.edgeConnectorState.pins[index].id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
|
|
5328
|
+
}, () => {
|
|
5329
|
+
let state = this.board;
|
|
5330
|
+
state.edgeConnectorState.pins[index].touched = false;
|
|
5331
|
+
let svgpin = this.pins[index];
|
|
5332
|
+
pxsim.U.removeClass(svgpin, "touched");
|
|
5333
|
+
this.updatePin(state.edgeConnectorState.pins[index], index);
|
|
5280
5334
|
this.board.bus.queue(state.edgeConnectorState.pins[index].id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
|
|
5281
5335
|
this.board.bus.queue(state.edgeConnectorState.pins[index].id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
|
|
5282
5336
|
});
|
|
@@ -5294,19 +5348,19 @@ path.sim-board {
|
|
|
5294
5348
|
attachButtonEvents(stateButton, buttonOuter, elButton) {
|
|
5295
5349
|
let pressedTime;
|
|
5296
5350
|
pxsim.pointerEvents.down.forEach(evid => buttonOuter.addEventListener(evid, ev => {
|
|
5297
|
-
// console.log(`down ${stateButton.id}`)
|
|
5298
5351
|
stateButton.pressed = true;
|
|
5299
|
-
|
|
5352
|
+
this.updateButtonPairs();
|
|
5300
5353
|
this.board.bus.queue(stateButton.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
|
|
5301
5354
|
pressedTime = pxsim.runtime.runningTime();
|
|
5302
5355
|
}));
|
|
5303
5356
|
buttonOuter.addEventListener(pxsim.pointerEvents.leave, ev => {
|
|
5304
5357
|
stateButton.pressed = false;
|
|
5358
|
+
this.updateButtonPairs();
|
|
5305
5359
|
pxsim.svg.fill(elButton, this.props.theme.buttonUp);
|
|
5306
5360
|
});
|
|
5307
5361
|
buttonOuter.addEventListener(pxsim.pointerEvents.up, ev => {
|
|
5308
5362
|
stateButton.pressed = false;
|
|
5309
|
-
|
|
5363
|
+
this.updateButtonPairs();
|
|
5310
5364
|
this.board.bus.queue(stateButton.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
|
|
5311
5365
|
const currentTime = pxsim.runtime.runningTime();
|
|
5312
5366
|
if (currentTime - pressedTime > 1000 /* DAL.DEVICE_BUTTON_LONG_CLICK_TIME */)
|
|
@@ -5315,8 +5369,13 @@ path.sim-board {
|
|
|
5315
5369
|
this.board.bus.queue(stateButton.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
|
|
5316
5370
|
pressedTime = undefined;
|
|
5317
5371
|
});
|
|
5318
|
-
pxsim.accessibility.enableKeyboardInteraction(buttonOuter,
|
|
5372
|
+
pxsim.accessibility.enableKeyboardInteraction(buttonOuter, () => {
|
|
5373
|
+
stateButton.pressed = true;
|
|
5374
|
+
this.updateButtonPairs();
|
|
5319
5375
|
this.board.bus.queue(stateButton.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
|
|
5376
|
+
}, () => {
|
|
5377
|
+
stateButton.pressed = false;
|
|
5378
|
+
this.updateButtonPairs();
|
|
5320
5379
|
this.board.bus.queue(stateButton.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
|
|
5321
5380
|
this.board.bus.queue(stateButton.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
|
|
5322
5381
|
});
|
|
@@ -5329,9 +5388,7 @@ path.sim-board {
|
|
|
5329
5388
|
bpState.aBtn.pressed = true;
|
|
5330
5389
|
bpState.bBtn.pressed = true;
|
|
5331
5390
|
bpState.abBtn.pressed = true;
|
|
5332
|
-
|
|
5333
|
-
pxsim.svg.fill(this.buttons[1], this.props.theme.buttonDown);
|
|
5334
|
-
pxsim.svg.fill(this.buttons[2], this.props.theme.buttonDown);
|
|
5391
|
+
this.updateButtonPairs();
|
|
5335
5392
|
this.board.bus.queue(bpState.abBtn.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
|
|
5336
5393
|
pressedTime = pxsim.runtime.runningTime();
|
|
5337
5394
|
}));
|
|
@@ -5339,17 +5396,13 @@ path.sim-board {
|
|
|
5339
5396
|
bpState.aBtn.pressed = false;
|
|
5340
5397
|
bpState.bBtn.pressed = false;
|
|
5341
5398
|
bpState.abBtn.pressed = false;
|
|
5342
|
-
|
|
5343
|
-
pxsim.svg.fill(this.buttons[1], this.props.theme.buttonUp);
|
|
5344
|
-
pxsim.svg.fill(this.buttons[2], this.props.theme.virtualButtonUp);
|
|
5399
|
+
this.updateButtonPairs();
|
|
5345
5400
|
});
|
|
5346
5401
|
this.buttonsOuter[2].addEventListener(pxsim.pointerEvents.up, ev => {
|
|
5347
5402
|
bpState.aBtn.pressed = false;
|
|
5348
5403
|
bpState.bBtn.pressed = false;
|
|
5349
5404
|
bpState.abBtn.pressed = false;
|
|
5350
|
-
|
|
5351
|
-
pxsim.svg.fill(this.buttons[1], this.props.theme.buttonUp);
|
|
5352
|
-
pxsim.svg.fill(this.buttons[2], this.props.theme.virtualButtonUp);
|
|
5405
|
+
this.updateButtonPairs();
|
|
5353
5406
|
this.board.bus.queue(bpState.abBtn.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
|
|
5354
5407
|
const currentTime = pxsim.runtime.runningTime();
|
|
5355
5408
|
if (currentTime - pressedTime > 1000 /* DAL.DEVICE_BUTTON_LONG_CLICK_TIME */)
|
|
@@ -5358,12 +5411,24 @@ path.sim-board {
|
|
|
5358
5411
|
this.board.bus.queue(bpState.abBtn.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
|
|
5359
5412
|
pressedTime = undefined;
|
|
5360
5413
|
});
|
|
5361
|
-
pxsim.accessibility.enableKeyboardInteraction(this.buttonsOuter[2],
|
|
5414
|
+
pxsim.accessibility.enableKeyboardInteraction(this.buttonsOuter[2], () => {
|
|
5415
|
+
bpState.aBtn.pressed = true;
|
|
5416
|
+
bpState.bBtn.pressed = true;
|
|
5417
|
+
bpState.abBtn.pressed = true;
|
|
5418
|
+
this.updateButtonPairs();
|
|
5362
5419
|
this.board.bus.queue(bpState.abBtn.id, 1 /* DAL.MICROBIT_BUTTON_EVT_DOWN */);
|
|
5420
|
+
}, () => {
|
|
5421
|
+
bpState.aBtn.pressed = false;
|
|
5422
|
+
bpState.bBtn.pressed = false;
|
|
5423
|
+
bpState.abBtn.pressed = false;
|
|
5424
|
+
this.updateButtonPairs();
|
|
5363
5425
|
this.board.bus.queue(bpState.abBtn.id, 2 /* DAL.MICROBIT_BUTTON_EVT_UP */);
|
|
5364
5426
|
this.board.bus.queue(bpState.abBtn.id, 3 /* DAL.MICROBIT_BUTTON_EVT_CLICK */);
|
|
5365
5427
|
});
|
|
5366
5428
|
}
|
|
5429
|
+
attachKeyboardEvents() {
|
|
5430
|
+
pxsim.accessibility.postKeyboardEvent();
|
|
5431
|
+
}
|
|
5367
5432
|
}
|
|
5368
5433
|
visuals.MicrobitBoardSvg = MicrobitBoardSvg;
|
|
5369
5434
|
})(visuals = pxsim.visuals || (pxsim.visuals = {}));
|
|
@@ -5377,7 +5442,7 @@ var pxsim;
|
|
|
5377
5442
|
const el = document.createElement("div");
|
|
5378
5443
|
el.setAttribute("id", "safari-mute-button-outer");
|
|
5379
5444
|
el.innerHTML = `
|
|
5380
|
-
<button class="safari-mute-button">
|
|
5445
|
+
<button class="safari-mute-button" tabindex="1">
|
|
5381
5446
|
${icon}
|
|
5382
5447
|
</button>
|
|
5383
5448
|
`;
|