Scratch for Java

ExtensionContext::onKey()

Browser availability: desktop-only.

This API requires the desktop runtime. Browser declarations may report the limitation without performing the operation.

Every key press and release, before learner code sees it; observe only. Game thread.

Syntax

Java

.onKey(hook)

Parameters

Name Data Type Description
hook Consumer<KeyEvent>

Return

void

onKey()

Create Shareable URL

Select Sections