Tecla Pulsada?

From StarLogo Nova Wiki
This page is a translated version of the page Key Held? and the translation is 64% complete.
Outdated translations are marked like this.
Other languages:
Key Held Block

Tecla [▼] Pulsada es un bloque de código parte de teclado cajón.

[▼] key held? is a code block part of the keyboard drawer.

Uso

[▼] key held? is a type of Lógica block that returns a boolean. Se devuelve un verdadero si una tecla específica indicada en el menú desplegable se mantiene presionada en el actual tick.

Sintaxis

Entradas:

  1. una tecla del teclado del menú desplegable

Example

Key Held example gif
Key Held example code

While “Catch Flies!” is toggled on, the up arrow key is held down causing the turtle to move forward. The left arrow key turns the turtle to the left as long as the button is held. Take note that the frog only moves while the key is held down.

Matices

Una diferencia importante entre [▼] key held? y [▼] key typed? es eso [▼] key typed? devuelve verdadero solo en ticks cuando se mantiene presionada la tecla específica y cuando no se mantuvo en el tick anterior.

Básicamente, [▼] key typed? devuelve verdadero solo en el tick cuando el botón se presiona por primera vez y no en ticks consecutivos. [▼] key held? devuelve verdadero para siempre mientras se mantenga presionada la tecla específica.

Bloques relacionados

Recursos de video relevantes

Actividades relevantes