Skip to content

Commit

Permalink
fix(useGamepad): explicitly ensure gamepad index is available (#3653)
Browse files Browse the repository at this point in the history
Co-authored-by: AntoninRousset <antonin@i-r-s.ch>
  • Loading branch information
AntoninRousset and AntoninRousset committed Feb 20, 2024
1 parent d33176e commit 8c73515
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/useGamepad/index.ts
Expand Up @@ -85,6 +85,7 @@ export function useGamepad(options: UseGamepadOptions = {}) {
hapticActuators,
axes: gamepad.axes.map(axes => axes),
buttons: gamepad.buttons.map(button => ({ pressed: button.pressed, touched: button.touched, value: button.value })),
index: gamepad.index,
} as Gamepad
}

Expand Down

0 comments on commit 8c73515

Please sign in to comment.