Skip to content

Add rumbleController API and Blockly block for gamepad haptics#345

Open
tracygardner wants to merge 1 commit intomainfrom
codex/find-controller-haptic-output-control-method-u81tgo
Open

Add rumbleController API and Blockly block for gamepad haptics#345
tracygardner wants to merge 1 commit intomainfrom
codex/find-controller-haptic-output-control-method-u81tgo

Conversation

@tracygardner
Copy link
Contributor

Motivation

  • Provide a simple cross-platform API to trigger controller vibration/haptics from scripts and Blockly, enabling richer tactile feedback in experiences.

Description

  • Add rumbleController(controller = "ANY", strength = 1, durationMs = 200) implementation in api/xr.js that normalizes inputs, locates a matching gamepad, and uses vibrationActuator or hapticActuators to play effects or pulse, returning Promise<boolean>.
  • Expose rumbleController in the public flock API and include it in the side-effect API list in flock.js.
  • Add a Blockly block definition in blocks/xr.js, a JS code generator in generators/generators.js, a toolbox entry in toolbox.js, and English localization/tooltip in locale/en.js.
  • Document the new function in API.md with parameters, return value, and an example.

Testing

  • Ran the project build (npm run build) and the test suite (npm test) after changes, and both completed successfully.
  • Linting (npm run lint) was executed and showed no new errors related to these changes.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant