From 4b2b82a22441f7ee2881c312f4705344cab41494 Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Mon, 10 Sep 2018 13:32:58 -0400 Subject: [PATCH] Fixing #1364: Microbit 'button pressed?' block should return true/false. --- src/extensions/scratch3_microbit/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extensions/scratch3_microbit/index.js b/src/extensions/scratch3_microbit/index.js index acac5c107..7fcc6c74b 100644 --- a/src/extensions/scratch3_microbit/index.js +++ b/src/extensions/scratch3_microbit/index.js @@ -751,11 +751,11 @@ class Scratch3MicroBitBlocks { */ isButtonPressed (args) { if (args.BTN === 'any') { - return this._peripheral.buttonA | this._peripheral.buttonB; + return (this._peripheral.buttonA | this._peripheral.buttonB) === 1; } else if (args.BTN === 'A') { - return this._peripheral.buttonA; + return this._peripheral.buttonA === 1; } else if (args.BTN === 'B') { - return this._peripheral.buttonB; + return this._peripheral.buttonB === 1; } return false; }