Buttons rename (#287)

* renaming up/down/click to released/pressed/bump

* missing images

* fixing signature issue

* updated strings

* white lego logo
This commit is contained in:
Peli de Halleux
2018-01-31 08:28:00 -08:00
committed by GitHub
parent ba1b9a54b4
commit ea956f1a73
50 changed files with 151 additions and 102 deletions

View File

@ -3,7 +3,7 @@
Run some code when a button is clicked, pressed down, or released.
```sig
brick.buttonEnter.onEvent(ButtonEvent.Click, function () {
brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
});
```
@ -15,7 +15,7 @@ brick.buttonEnter.onEvent(ButtonEvent.Click, function () {
Your @boardname@ has touch sensors that work like buttons. Instead of saying `enter` or `left` as the source button, use a touch sensor block with a sensor name like `touch 1`.
```block
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
sensors.touch1.onEvent(ButtonEvent.Pressed, function () {
brick.setLight(BrickLight.Orange);
});
```
@ -38,13 +38,13 @@ Check for event on the ENTER button. Put a message on the screen when the button
```blocks
brick.showString("ENTER is: UP", 1);
brick.buttonEnter.onEvent(ButtonEvent.Up, function () {
brick.buttonEnter.onEvent(ButtonEvent.Released, function () {
brick.showString("ENTER is: UP ", 1);
});
brick.buttonEnter.onEvent(ButtonEvent.Down, function () {
brick.buttonEnter.onEvent(ButtonEvent.Pressed, function () {
brick.showString("ENTER is: DOWN ", 1);
});
brick.buttonEnter.onEvent(ButtonEvent.Click, function () {
brick.buttonEnter.onEvent(ButtonEvent.Bumped, function () {
brick.showString("ENTER was: CLICKED", 1);
});
```