-
Notifications
You must be signed in to change notification settings - Fork 38
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
System 2449/fix gamepad #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Edit;
Oups, missed some commit.
The #72 need to be discuss with Julien tomorrow (04/04), the code could change after that
I think the first commit should not be in this PR ? Or maybe this PR should not target |
yes it cames from this PR |
src/plugins/GamepadManager.js
Outdated
this.currentGamepads[localIndex] = {remoteIndex: remoteIndex, buttons: []}; | ||
const gamepad = this.getRawGamepad(remoteIndex); | ||
this.currentGamepads[localIndex] = {remoteIndex: remoteIndex, | ||
buttons: [gamepad.buttons.length], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of getRawGamepad doesn't return a gamepad and wathever you return from getRawGamepad ( undefined or null) you wil get an uncaught error here : Uncaught TypeError: gamepad is null
src/plugins/GamepadManager.js
Outdated
this.currentGamepads[hostIndex] = {remoteIndex: hostIndex, | ||
buttons: [gamepad.buttons.length], | ||
axes: [gamepad.axes.length]}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.currentGamepads[hostIndex] = {remoteIndex: hostIndex, | |
buttons: [gamepad.buttons.length], | |
axes: [gamepad.axes.length]}; | |
this.currentGamepads[hostIndex] = { | |
remoteIndex: hostIndex, | |
buttons: [gamepad.buttons.length], | |
axes: [gamepad.axes.length] | |
}; |
I think it would be more readable like this. But maybe simply use the yarn validate --fix
command to fix the code style everywhere.
f40cd2d
to
0f1448b
Compare
8a4ce29
to
0611484
Compare
0611484
to
bbc9dae
Compare
- handle gamepad pugged/unplugged - catch and handle confirmation - send correct vinput gamepad redis message - Handle axis changes - Rework catch and dispatch event to dispatch it only when axes changed - Add vendor id and product id to the plugg in command
bbc9dae
to
2f6c615
Compare
Description
Rework Gamepad and Gamepad Management to fix:
- handle gamepad pugged/unplugged
- catch and handle confirmation
- send correct vinput gamepad redis message
- Handle axis changes
- Rework catch and dispatch event to dispatch it only when axes changed
- Add vendor id and product id to the plugg in command
Type of change
Checklist