implement wasPressed

This commit is contained in:
Peli de Halleux 2017-11-28 15:33:43 -08:00
parent 71479d0caa
commit b57ae5d588

View File

@ -68,6 +68,7 @@ namespace brick {
_update(curr: boolean) { _update(curr: boolean) {
if (this._isPressed == curr) return if (this._isPressed == curr) return
this._isPressed = curr this._isPressed = curr
if (curr) this._wasPressed = true;
if (curr) { if (curr) {
this.downTime = control.millis() this.downTime = control.millis()
control.raiseEvent(this._id, ButtonEvent.Down) control.raiseEvent(this._id, ButtonEvent.Down)