Mouse Wheel Scrolling Detection

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

Шаблон:Stub This tutorial shows how to program mouse wheel scrolling detection in Scratch 1.4, 2.0 and 3.0.

Script

The when () key pressed block fires both when the up and down keys are pressed and when the mouse wheel is scrolled up or down, while the key () pressed? block only returns true if the arrow key is being pressed.

Add these scripts to the project:

when [up arrow v] key pressed
if <not <key (up arrow v) pressed?>> then
 . . . // scrolling up
end

when [down arrow v] key pressed
if <not <key (down arrow v) pressed?>> then
 . . . // scrolling down
end

Example Uses

See Also