Skip to content
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

Merged
merged 1 commit into from
Sep 21, 2022
Merged

add support HVCControllers #5

merged 1 commit into from
Sep 21, 2022

Conversation

taisukef
Copy link
Collaborator

Thank you for great code!
I added a support for HVCController.

https://twitter.com/taisukef/status/1572349705828569092

if (joyCon instanceof JoyConLeft) {
const joystick = packet.analogStickLeft;
if (joyCon instanceof HVCController) {
// from left
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// from left
// From left.

document
.querySelector('#joystick-left')
.classList.toggle('highlight', buttons.leftStick);
// from right
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// from right
// From right.

*/
class HVCController extends JoyConRight {
/**
*Creates an instance of HVCController.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*Creates an instance of HVCController.
* Creates an instance of HVCController.

*/
class HVCController extends JoyConRight {
/**
*Creates an instance of HVCController.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*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 ")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (device.productName.startsWith("HVC Controller ")) {
if (device.productName.startsWith('HVC Controller')) {

Copy link
Owner

@tomayac tomayac left a 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.

@tomayac tomayac merged commit 08d44b3 into tomayac:main Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants