V4 updates (#210)

* update pxt.json files

* Fix button event enums

fixes https://github.com/microsoft/pxt-calliope/issues/206

* Fix Safari CSS Rule for iOS app

fixes https://github.com/microsoft/pxt-calliope/issues/205

* aprove preffered repos

should fix https://github.com/microsoft/pxt-calliope/issues/167
This commit is contained in:
Juri Wolf
2023-01-11 18:51:27 +01:00
committed by GitHub
parent 1aaedf1fa0
commit 77ed2ccfb1
62 changed files with 223 additions and 162 deletions

View File

@ -17,7 +17,7 @@ if (led.point(1,1) && led.point(2,2)) {
When you compare two Numbers, you get a Boolean value, such as the comparison `x < 5` in the code below:
```blocks
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
let x = randint(0, 5)
if(x < 5) {
basic.showString("low");

View File

@ -7,7 +7,7 @@
If the [light level](/reference/input/light-level) is `< 100`, this code sets the brightness to `255` when the button A is pressed:
```blocks
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
if(input.lightLevel()<100){
led.setBrightness(255);
}

View File

@ -7,7 +7,7 @@
This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.
```blocks
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
for(let i = 0; i < 5; ++i) {
basic.showNumber(i)
}

View File

@ -7,7 +7,7 @@
The following example uses a while loop to make a diagonal line on the LED screen (points `0, 0`, `1, 1`, `2, 2`, `3, 3`, `4, 4`).
```blocks
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
let index = 4;
while(index >= 0) {
led.plot(index, index);

View File

@ -5,7 +5,7 @@
In this example, ``on start`` sets a dimmer brightness on the screen and the button handler shows a string.
```blocks
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
basic.showString("Hello!")
})
led.setBrightness(50)

View File

@ -59,7 +59,7 @@ A counter is a great example:
```blocks
let counter = 0;
input.onButtonEvent(Button.A, ButtonEvent.Down, () => {
input.onButtonEvent(Button.A, input.buttonEventValue(ButtonEvent.Down), () => {
counter = counter + 1;
basic.showNumber(counter);
});