Device: Logitech G502 X PLUS
Encountered an issue where re-binding keys which previously had modifiers assigned (e.g. ALT+KEY_LEFT), resulted in the modifier being retained. This small change clears modifiers before assigning new keys or macros. Keys are still able to be assigned modifiers, as assignment hasn't changed.
I didn't see a PR template, so I'm just doing my best here...
- Assigned the back button the default setting
- Changed back button to send comma key
- before: sent `ALT+,`
- after: sent `,` ✔️
- Assigned back button to send `ALT+LEFT_ARROW`
- Changed back button to send comma key
- before: sent `ALT+,`
- after: sent `,` ✔️
- Assigned back button to send comma key
- Changed back button to send `ALT+,`
- before: sent `ALT+,`
- after: sent `ALT+,` ✔️
Closes https://github.com/libratbag/libratbag/issues/1853
Closes https://github.com/libratbag/piper/issues/835
* Added Quirk for G502 offset to resolve incorrect active profile being applied. Testing on G502- Hero Wireless. May be worth adding handling for multiple quirks.
* Added quirk in device files to correct offset for G502 Hero, G502-Proteus Spectrum, and G604.
* Refactored G502 Offset Quirk naming to be more broadly applicable as index offset.
* Correct typo in g502-proteus spectrum quirk value.
---------
Co-authored-by: Patrick Klose <pjklose@outlook.com>
* Recognize the Logitech G502X PLUS (Wired)
* Fixed: LED write functionality for G502X PLUS
Inspired by 94bd172a19
* Changed: Number of LEDs is implied by quirk set.
* Added: Extra note about single LED
Macros can be used for that instead, drivers can adapt them as needed.
Simple key actions will stay here for now, but I plan to completely
replace them with macros eventually.
Although it does work for some mice and fixes there being several
configurable devices for a single mouse in libratbag, for some mice it
does *not* apply, making them unusable with libratbag.
This erroneously declared it with name `__packed__` instead of using it
as an attribute.
It doesn't seem like it changes struct's size, but it has no
static_assert on it so we can't be 100% sure.
If by any chance returned `size` was `0`, it would erroneously return 0,
which would do an uninitialized pointer dereference in
sinowealthnubwo_probe().
This fixes a convoluted warning by clang-analyze.