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 G705 Mouse support #1586

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add G705 Mouse support #1586

wants to merge 5 commits into from

Conversation

Nadeflore
Copy link

This device needs the led effect settings for the first (and only) led cluster to be written in the second led slot in the profile data.

I wasn't sure how to do this without breaking the compatibility with other devices, so I conditioned it the profile type, but maybe there's a better way.

@Nadeflore
Copy link
Author

Nadeflore commented Feb 10, 2024

In order to get the mouse to work while connected with the lightspeed receiver,
I had to add this device file :

[Device]
Name=Logitech G705
DeviceMatch=usb:046d:c547
Driver=hidpp20
DeviceType=mouse

[Driver/hidpp20]
DeviceIndex=1

But this makes the test receiver-id-test fails. Because apparently this is a generic receiver.

As as understand it, the kernel is supposed to support logitech receiver, so that each device connected to the receiver appears as a wired one, but that's not happening with this device.

src/hidpp20.h Outdated Show resolved Hide resolved
src/hidpp20.c Outdated Show resolved Hide resolved
Copy link
Member

@staticssleever668 staticssleever668 left a comment

Choose a reason for hiding this comment

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

Hi! Thank you for your contribution! I left a few suggestions, please, look at them.

Use device pid instead of receiver pid
requires a kernel supporting the PID 0xc547 receiver
See libratbag#1119
This field seemed to be unused in previous profile format.
But with the profile format 0x05 it appears to control
whether or not the custom animations are used.
@Nadeflore
Copy link
Author

Nadeflore commented Feb 18, 2024

Hi !
Thanks for you feedback.
I made the requested changes.
Let me know if there is anything else I need to do

Comment on lines +2961 to +2962
// This field needs to be zero for leds to work in G705
// If a non zero value is set, custom animation will be used instead
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment should go above the custom_animation_g705 struct field instead.

@@ -2959,6 +2958,10 @@ hidpp20_onboard_profiles_write_profile(struct hidpp20_device *device,

memcpy(pdata->profile.name.txt, profile->name, sizeof(profile->name));

// This field needs to be zero for leds to work in G705
// If a non zero value is set, custom animation will be used instead
pdata->profile.custom_animation_g705 = 0x00;
Copy link
Member

Choose a reason for hiding this comment

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

Could you put this under a check for G705? Just to make sure we don't accidentally introduce regressions for other devices. I don't have any experience with HID++ myself, so we should be extra careful.

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