Run the passed callback function on any gamepad axis update.
import useAxisChange from 'react-ctrls/useAxisChange';
const MyComponent = () => {
useAxisChange((data) => {
console.log(data);
});
return <div>...</div>;
};
interface IGamepadEventData {
gamepad: Gamepad;
index: number;
value: number;
}
Refer to mappings to target axes on various gamepads.