-
Notifications
You must be signed in to change notification settings - Fork 26
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
Possible bug/user inconvenience in handling the maximum number of banks/profiles. #23
Comments
Hi there! Very good find! Setting a constant per keyboard makes sense to me, I agree on that. I also feel like, we shouldn't create storage folders in Furthermore, Alternatively, we could scratch Cheers, |
Maybe use a constant class member function instead of a constant variable. Something like at least we can determine the number of to be created profile folders for each supported keyboard that way. |
I was planning to move the profile creation code to its own function e.g. I think it depends on the hardware, whether setting multiple LEDs at once is supported or not. For the SideWinder X4, X6 and the Logitech G710, I've tried it out personally and can confirm it works. However, I don't have plans to implement such a feature in I think auto profile is a more useful feature in that regard. It enables you to have profile sets per application, which automatically switch, as soon as you switch the application. A global profile set is applied, as soon as your active application doesn't have a profile. |
The current maximum number of supported profiles is stored here as
const int MAX_PROFILE = 3;
sidewinderd/src/core/keyboard.hpp
Line 29 in b167c93
It is used in keyboard.cpp to create the macro storage folders for each profile. This is not a problem.
Just for reference, exactly here:
sidewinderd/src/core/keyboard.cpp
Line 223 in b167c93
The actual problem is that this constant originates from
sidewinder.hpp
and is still used with a different purpose insidewinder.cpp
, here:sidewinderd/src/vendor/microsoft/sidewinder.cpp
Line 43 in b167c93
This will lead to a bug as soon as another keyboard is added that offers >= 4 profiles. MAX_PROFILE will be increased and the code in sidewinder.cpp will break without notice, because it depends on that constant being exactly 3.
The profile rotation for the Sidewinder keyboard should always be 1 → 2 → 3 → 1.
Let
MAX_PROFILE
be redefined to 10. Then the profile rotation on the sidewinder keyboard will become1 → 2 → 3 → 3 → 3 → 3 → 3 → 3 → 3 → 3 → 1
, which I consider as unintended.Possible fix for that possible bug:
Use a constant per keyboard, so that adding new keyboards won’t break old ones.
MAX_PROFILE in keyboard.hpp must then be set to the maximum profile number across all supported keyboards.
The text was updated successfully, but these errors were encountered: