Class GamepadExtension
java.lang.Object
org.openpatch.scratch.gamepad.GamepadExtension
- All Implemented Interfaces:
Extension
Registers the gamepad extension; found through ServiceLoader, learners never see it. Polls the
controllers once per batch of ticks (GLFW polling only, never a callback) and turns the changes
between ticks into the
GamepadListener calls, at the same point of the tick as key
events.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GamepadSourceThe current source of the controllers' state.id()A short unique id such as"tiled", used in messages.voidinstall(ExtensionContext ctx) Adds the extension's hooks.name()A name for people, such as"Tiled maps".requires()First-party extensions are released together with the core.static voidReplaces where the controllers' state comes from, for tests and parity scripts.version()The extension's own version.
-
Constructor Details
-
GamepadExtension
public GamepadExtension()
-
-
Method Details
-
id
-
name
-
version
-
requires
-
install
Description copied from interface:ExtensionAdds the extension's hooks. Called once, on the window thread, before the first stage. -
useSource
Replaces where the controllers' state comes from, for tests and parity scripts. The new source is read from the next batch of ticks on;nullis not allowed.- Parameters:
s- the new source
-
getSource
The current source of the controllers' state.
-