Control event value in simulator (#343)

* implement pxsim.control.eventValue and pxsim.control.eventTimestamp in the simulator
This commit is contained in:
chmora 2017-01-13 16:46:52 -08:00 committed by Sam El-Husseini
parent e15da5dee1
commit 00f4c9cbb3
2 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,6 @@
"semantic-ui-less": "^2.2.4" "semantic-ui-less": "^2.2.4"
}, },
"dependencies": { "dependencies": {
"pxt-core": "0.10.4" "pxt-core": "0.10.5"
} }
} }

View File

@ -65,6 +65,14 @@ namespace pxsim.control {
// TODO mode? // TODO mode?
board().bus.queue(id, evid) board().bus.queue(id, evid)
} }
export function eventValue(): number | string {
return board().bus.getLastEvent();
}
export function eventTimestamp(): number {
return board().bus.getLastEventTime();
}
} }
namespace pxsim.pxtcore { namespace pxsim.pxtcore {