adding button class on remote buttons
This commit is contained in:
parent
56dd8e0875
commit
538493369b
@ -24,13 +24,13 @@ namespace pxsim {
|
|||||||
switch(this.state) {
|
switch(this.state) {
|
||||||
case InfraredRemoteButton.TopLeft: return 1;
|
case InfraredRemoteButton.TopLeft: return 1;
|
||||||
case InfraredRemoteButton.BottomLeft: return 2;
|
case InfraredRemoteButton.BottomLeft: return 2;
|
||||||
case InfraredRemoteButton.TopLeft: return 3;
|
case InfraredRemoteButton.TopRight: return 3;
|
||||||
|
case InfraredRemoteButton.CenterBeacon: return 9;
|
||||||
case InfraredRemoteButton.TopRight | InfraredRemoteButton.BottomRight: return 4;
|
case InfraredRemoteButton.TopRight | InfraredRemoteButton.BottomRight: return 4;
|
||||||
case InfraredRemoteButton.TopLeft | InfraredRemoteButton.TopRight: return 5;
|
case InfraredRemoteButton.TopLeft | InfraredRemoteButton.TopRight: return 5;
|
||||||
case InfraredRemoteButton.TopLeft | InfraredRemoteButton.BottomRight: return 6;
|
case InfraredRemoteButton.TopLeft | InfraredRemoteButton.BottomRight: return 6;
|
||||||
case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.TopRight: return 7;
|
case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.TopRight: return 7;
|
||||||
case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.BottomRight: return 8;
|
case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.BottomRight: return 8;
|
||||||
case InfraredRemoteButton.CenterBeacon: return 9;
|
|
||||||
case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.TopLeft: return 10;
|
case InfraredRemoteButton.BottomLeft | InfraredRemoteButton.TopLeft: return 10;
|
||||||
case InfraredRemoteButton.TopRight | InfraredRemoteButton.BottomRight: return 11;
|
case InfraredRemoteButton.TopRight | InfraredRemoteButton.BottomRight: return 11;
|
||||||
default: return 0;
|
default: return 0;
|
||||||
|
@ -28,11 +28,11 @@ namespace pxsim.visuals {
|
|||||||
"bottomleft": InfraredRemoteButton.BottomLeft,
|
"bottomleft": InfraredRemoteButton.BottomLeft,
|
||||||
"bottomright": InfraredRemoteButton.BottomRight
|
"bottomright": InfraredRemoteButton.BottomRight
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(btns).forEach(bid => {
|
Object.keys(btns).forEach(bid => {
|
||||||
const cid = btns[bid];
|
const cid = btns[bid];
|
||||||
const bel = content.getElementById(pxsim.visuals.normalizeId(this.id, bid));
|
const bel = content.getElementById(pxsim.visuals.normalizeId(this.id, bid));
|
||||||
bel.className += " sim-button";
|
bel.setAttribute("class", "sim-button");
|
||||||
pointerEvents.down.forEach(evid => bel.addEventListener(evid, ev => {
|
pointerEvents.down.forEach(evid => bel.addEventListener(evid, ev => {
|
||||||
ev3board().remoteState.setPressed(cid, true);
|
ev3board().remoteState.setPressed(cid, true);
|
||||||
}));
|
}));
|
||||||
|
Loading…
Reference in New Issue
Block a user