Number Pad Detection

Материал из Поле цифровой дидактики

Шаблон:Obsolete feature This tutorial shows how to detect if a numpad key is down in Scratch 1.4.

Script

The When () Key Pressed block fires either when a number key is pressed using the writing row or the numeric pad. The Key () Pressed? block with the numbers 0-9 selected, however, only reports true if the number in the writing row is down.

Add this script to the project:

when1keypressedifkey1pressed?thensettypeofnumbertowritingfield"1"elsesettypeofnumbertonumericfield"1"end

The script is now complete. Repeat for the other 9 keys.

Example Uses

See Also

ja:テンキーを検出する