-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Game Pad Component #12
Comments
Hi @geyang, I love vuer, I am currently building a teleop setup with it. And I realized the gamepad component doesn't work at this point (or I am using it in the wrong way :D). Any updates on this? Would love to support, but it seems to be a client problem. I couldn't find the client code. Cheers |
Hi @marctuscher, here is the code for the Gamepad component : ) import { useGamepads } from 'react-gamepads';
import { ClientEvent, VuerProps } from '../../vuer/interfaces';
import { SocketContextType, useSocket } from '../../vuer/websocket';
export function Gamepad({ _key: key, children }: VuerProps) {
const { sendMsg } = useSocket() as SocketContextType;
useGamepads((gamepads) => {
const { axes, buttons } = gamepads[0] as Gamepad;
sendMsg({
ts: Date.now(),
etype: 'GAMEPADS',
key,
value: { axes, buttons: buttons.map((b) => b.value) },
} as ClientEvent);
});
return <>{children}</>;
} We currently do not have an example in the documentation, if you get this work feel free to add an example under |
Hi @geyang, I am also interested in the gamepad component and Quest3 joystick controller components. I am interested in adding a new etype for these new components on the client side, but I am unable to find the client code. How do you suggest contributing these features? Are you able to release the full client code with instructions on how to build the client and test client locally? |
No description provided.
The text was updated successfully, but these errors were encountered: