Closed audunmg closed 1 year ago
This is an old Logitech device, and uses an old version of the Logitech HID++ protocol. Solaar mostly supports the new version, which does not require that Solaar have descriptions for the capabilities of each device. What Solaar is doing is recognizing your device by its WPID and using the description that Solaar has for this WPID
_D('Number Pad N545', protocol=1.0, wpid='2006', registers=(_R.battery_status, ))
It looks as if this WPID (which identifies the internal controls for the device) has been used for multiple models, probably for different regions.
It is entirely possible that the Logitech driver for this device does something special with it that Solaar cannot do, as Solaar is not a device driver. To determine whether this device has the capability of doing anything that Solaar can control would require you to probe the device using the Solaar hidconsole tool. To determine how to probe and how to interpret the answer would require observing how the Logitech driver communicates with the device under Windows, using some tool in Windows to capture the interactions or getting the HID++ 1.0 specification from Logitech under NDA. The former path is how the limited support for HID++ 1.0 devices was developed in Solaar.
So adding support for what you want may be impossible or may only be very difficult and can only be done by you.
Some information on HID++ 1.0 is available at https://github.com/cvuchener/hidpp. Use hidpp-list-devices to find out which devices you have and then hidpp-list-features -d N [-w] /dev/hidrawM to list the registers and features of a device. The -w flag also writes to registers, but may interfere with the workings of the device. If you report back the results then I may be able to look up what the registers do.
I see.
I'll try to get a USB capture with wireshark and a VM when time allows.
It doesn't seem to have many registers, maybe that helps?
Output of hidpp-list-features -d 3 /dev/hidraw2
:
N305/B505 (046d:2006) is a HID++ 1.0 device
Register 0x00 read 3: 10 00 00
Register 0x01 read 3: 00 00 00
Register 0x07 read 3: 07 00 00
Register 0x09 read 3: 00 00 00
Register 0xd0 read 3: 00 00 00
Register 0xf1 read 3: Invalid value (0x03)
Register 0xf3 read 3: 00 00 00
Output of hidpp-list-features -d 3 -w /dev/hidraw2
:
N305/B505 (046d:2006) is a HID++ 1.0 device
Register 0x00 read 3: 10 00 00
Register 0x00 write 3: 00 00 00
Register 0x01 read 3: 00 00 00
Register 0x01 write 3: 00 00 00
Register 0x07 read 3: 07 00 00
Register 0x09 read 3: 00 00 00
Register 0x09 write 3: 00 00 00
Register 0xd0 read 3: 00 00 00
Register 0xd0 write 3: 00 00 00
Register 0xf0 write 3: Invalid value (0x03)
Register 0xf1 read 3: Invalid value (0x03)
Register 0xf3 read 3: 00 00 00
Register 0xf3 write 3: 00 00 00
Individual features: 100004
- Enhanced Key Usage
Thank you for pointing me in the right direction.
Register 0 is used to turn on HID++ reporting. The bit in the this register means that the device is reporting changes to its battery state. There are bits in this register that might change how the keys on your device work.
Register 1 is used to enable individual features. Enhanced key usage changes how the Fn key works, either as a normal Fn key or to send HID++ reports, but it is unclear whether the device actually has a Fn key. The other bit in this register is to disable num lock toggle. I'm not sure whether the device has a key that can be used to toggle num lock, though.
Register 7 is used to query battery status. The device is reporting a full battery.
Register 9 is used to toggle Fn status. It may be possible to use this to change how some of the keys on the device work.
Register D0 is unknown.
Register F0 is unknown.
Register F1 is used to get information about the firmware version.
Register F3 is unknown.
It may be that some numpads with this WPID have a Fn key. It also might be possible to use the registers to toggle Fn status and thus change how the function keys - probably the top three keys - work. It also might be possible to have some or all keys send HID++ reports that can be used in Solaar rules.
Changing the Fn status is the easiest. Clone Solaar and change the device description in lib/logitech_receiver/descriptors.py to
_D('Number Pad N545', protocol=1.0, wpid='2006', registers=(_R.battery_status, ), settings=[_ST.RegisterFnSwap])
Then quit out of Solaar and start it up again as bin/Solaar from your Solaar directory. You should see a setting for Swap Fx function. Change it and see whether the behaviour of any keys change. If this works for you then you don't need to go further.
Changing the keys to send HID++ reports requires more changes to Solaar. The first thing to do would be to send commands to the device to try to get it to change its behaviour. Clone the Solaar if you haven't already done so. Then use ./tools/hidconsole in the Solaar. You have to find out the /dev/hidrawN for the device and its device number, which you can get via solaar show
. The device number is the first thing that Solaar show emits.
You then run ./tools/hidconsole /dev/hidrawN
for N that you just found out. Send the command
10 DN 80 00 FF FF FF
where DN is the device number as two hexidecimal digits.
If that doesn't produce an error see the result by sending the command
10 DN 81 00 00 00 00
If the result is different from
10 DN 81 00 10 00 00
try using the device and see what changed. Keep hidconsole running. If some keys appear to be doing nothing then see what hidconsole prints for them.
Turning the device off and on again should reset its behaviour.
If the first command did produce an error try
10 DN 80 00 91 00 00
and then query as able and see what changed.
Report back on what you did and the results.
Closing due to no response from submitter.
This issue can be reopened when more information is provided.
Information
uname -srmo
): Linux 6.0.12-zen1-1-zen x86_64 GNU/Linuxsolaar solaar show 'Number Pad N545'
: the correct model name should be N305~/.config/solaar/config.yaml
(or~/.config/solaar/config.json
if~/.config/solaar/config.yaml
not present):Is your feature request related to a problem? Please describe. The N305 Number pad shows up as N545 and works mostly as normal, but is not customizable.
I think some of the keys are remappable in windows, but not in Solaar, especially two buttons with excel and calculator icon.
Other buttons present are equals, left parenthesis, right parentehsis, backspace, "clear", and the normal Number pad buttons.
Out of the box, they do keypresses for: win+r, typing "calc" (or excel), and enter.
The equals and parenthesis buttons do: turn numlock on, key down Alt_L, Key in the keycode for the symbol, 4,4,0,0 for left parens, 4,4,1,1 for right parens, 6,6,1,1 for equals.
This doesn't work well on linux.
The number pad buttons do: turn on numlock, KP_, turn off numlock, so they work.
The Clear-button is mapped to delete, and backspace and numpad enter work as normal.
Describe the solution you'd like Would be very nice to remap or disable the "macro"-like keys.
Additional context Add any other context or screenshots about the feature request here.
/sys/class/hidraw/hidraw3/device/uevent:
cat /sys/class/hidraw/hidraw3/device/report_descriptor | base64
I'm more than happy to test or provide more data.