Button event down (#1189)

* support for button_down events

* support for AB button
This commit is contained in:
Peli de Halleux
2018-09-07 08:03:15 -07:00
committed by GitHub
parent 1767e3d10c
commit 47634d52e8
2 changed files with 13 additions and 0 deletions

View File

@ -62,6 +62,13 @@ namespace pxsim.control {
}
export function onEvent(id: number, evid: number, handler: RefAction) {
if (id == DAL.MICROBIT_ID_BUTTON_AB) {
const b = board().buttonPairState;
if (!b.usesButtonAB) {
b.usesButtonAB = true;
runtime.queueDisplayUpdate();
}
}
pxtcore.registerWithDal(id, evid, handler)
}