-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
add support HVCControllers #5
Conversation
if (joyCon instanceof JoyConLeft) { | ||
const joystick = packet.analogStickLeft; | ||
if (joyCon instanceof HVCController) { | ||
// from left |
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.
// from left | |
// From left. |
document | ||
.querySelector('#joystick-left') | ||
.classList.toggle('highlight', buttons.leftStick); | ||
// from right |
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.
// from right | |
// From right. |
*/ | ||
class HVCController extends JoyConRight { | ||
/** | ||
*Creates an instance of HVCController. |
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.
*Creates an instance of HVCController. | |
* Creates an instance of HVCController. |
*/ | ||
class HVCController extends JoyConRight { | ||
/** | ||
*Creates an instance of HVCController. |
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.
*Creates an instance of HVCController. | |
* Creates an instance of HVCController. |
@@ -48,12 +49,16 @@ const connectDevice = async (device) => { | |||
if (device.productId === 0x2006) { | |||
joyCon = new JoyConLeft(device); | |||
} else if (device.productId === 0x2007) { | |||
joyCon = new JoyConRight(device); | |||
if (device.productName.startsWith("HVC Controller ")) { |
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.
if (device.productName.startsWith("HVC Controller ")) { | |
if (device.productName.startsWith('HVC Controller')) { |
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, thank you very much! I will take care of the suggestions myself.
Thank you for great code!
I added a support for HVCController.
https://twitter.com/taisukef/status/1572349705828569092