Package org.openpatch.scratch.gamepad


package org.openpatch.scratch.gamepad
Controller support: up to four gamepads, polled every tick. Ask them anywhere with Gamepad, or implement GamepadListener on the stage or a sprite to be told about button presses and controllers connecting. Buttons are in Xbox positions (A is Cross on a PlayStation controller, see GamepadButton); sticks report y up, as on the stage, and a stick near its middle reports (0, 0). Controllers without a known layout are skipped. There is no rumble.

In the -all jar and Studio; with Maven add the artifact scratch-gamepad.

  • Class
    Description
    Asks the connected controllers, like a gamepad's blocks in other Scratch dialects.
    A button of a gamepad, in Xbox positions.
    Registers the gamepad extension; found through ServiceLoader, learners never see it.
    What a stage or sprite is told about the controllers, at the same point of the tick as key events (before run()): a button going down or up on any player's controller, and a controller appearing in a player's slot.
    Where the controllers' state comes from.
    What the controllers were like at one point in time: every player slot's buttons, sticks and triggers.
    One of a gamepad's two sticks.
    One of a gamepad's two analog triggers (the shoulder buttons that go down gradually).