From 893dd0f9c436b4bc7035fd9d268e2795730806a2 Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 11 Jan 2018 08:28:25 -0800 Subject: [PATCH] rename "enter..." to "button enter" --- libs/core/_locales/core-strings.json | 10 +++++----- libs/core/buttons.ts | 11 ++++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libs/core/_locales/core-strings.json b/libs/core/_locales/core-strings.json index 33ac132c..cb480eca 100644 --- a/libs/core/_locales/core-strings.json +++ b/libs/core/_locales/core-strings.json @@ -30,11 +30,11 @@ "brick.Button.pauseUntil|block": "pause until %button|%event", "brick.Button.wasPressed|block": "%button|was pressed", "brick.batteryLevel|block": "battery level", - "brick.buttonDown|block": "down", - "brick.buttonEnter|block": "enter", - "brick.buttonLeft|block": "left", - "brick.buttonRight|block": "right", - "brick.buttonUp|block": "up", + "brick.buttonDown|block": "button down", + "brick.buttonEnter|block": "button enter", + "brick.buttonLeft|block": "button left", + "brick.buttonRight|block": "button right", + "brick.buttonUp|block": "button up", "brick.clearScreen|block": "clear screen", "brick.lightPattern|block": "%pattern", "brick.printPorts|block": "print ports", diff --git a/libs/core/buttons.ts b/libs/core/buttons.ts index ab3e3854..b9a3af97 100644 --- a/libs/core/buttons.ts +++ b/libs/core/buttons.ts @@ -170,6 +170,7 @@ namespace brick { // this needs to be done in query(), which is run without the main JS execution mutex // otherwise, while(true){} will lock the device if (ret & DAL.BUTTON_ID_ESCAPE) { + motors.stopAllMotors(); // ensuring that all motors are off control.reset() } return ret @@ -203,31 +204,31 @@ namespace brick { /** * Enter button on the EV3 Brick. */ - //% whenUsed block="enter" weight=95 fixedInstance + //% whenUsed block="button enter" weight=95 fixedInstance export const buttonEnter: Button = new DevButton(DAL.BUTTON_ID_ENTER) /** * Left button on the EV3 Brick. */ - //% whenUsed block="left" weight=95 fixedInstance + //% whenUsed block="button left" weight=95 fixedInstance export const buttonLeft: Button = new DevButton(DAL.BUTTON_ID_LEFT) /** * Right button on the EV3 Brick. */ - //% whenUsed block="right" weight=94 fixedInstance + //% whenUsed block="button right" weight=94 fixedInstance export const buttonRight: Button = new DevButton(DAL.BUTTON_ID_RIGHT) /** * Up button on the EV3 Brick. */ - //% whenUsed block="up" weight=95 fixedInstance + //% whenUsed block="button up" weight=95 fixedInstance export const buttonUp: Button = new DevButton(DAL.BUTTON_ID_UP) /** * Down button on the EV3 Brick. */ - //% whenUsed block="down" weight=95 fixedInstance + //% whenUsed block="button down" weight=95 fixedInstance export const buttonDown: Button = new DevButton(DAL.BUTTON_ID_DOWN) }