Number Pad Detection: различия между версиями
Материал из Поле цифровой дидактики
м removed superfluous category |
Patarakin (обсуждение | вклад) м 1 версия импортирована |
||
(нет различий)
| |||
Текущая версия от 11:33, 21 июля 2022
Шаблон: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:
when [1 v] key pressed if <key [1 v] pressed?>then set [type of number v] to [writing field "1"] else set [type of number v] to [numeric field "1"] end
The script is now complete. Repeat for the other 9 keys.
Example Uses
- Adding a hidden menu
- Making Operating System projects more realistic
