-
-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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
Sequencer keycodes are not static #11156
Comments
I confirm, after #9940 all RGB control keycodes are shifted in VIA, which leads to wrong keycode indication. |
I don’t know about VIA, is there a place where I can read more about it? |
There is not much info there on what exactly it is or does, but essentially, it is a feature of QMK, and a host-side app, which allows you to change your keymap without flashing by storing it in EEPROM, and control certain things like RGB and backlighting from the host. Unfortunately there is no way for the VIA app to know what value each keycode is, because the full enum is not stored in the firmware. It has to maintain its own list of keycode values to send to the keyboard, and hope that it does not change, which it just has. So, every entry in the |
I think I need some help to understand what the issue is exactly.
If the number of keycodes potentially assigned to the sequencer is still problematic, maybe we can adapt the feature so that it works with a richer state and combination of keycodes instead. Examples:
This means we’d only have a few "sequencer mode" keycodes that would not vary with the number of tracks/steps/resolutions the end user wants to configure. But again, I’d like to understand the issue better before jumping on a solution 🙂 |
As I mentioned above, VIA needs to know the exact values of each keycode in order to use them, which means they must always be the same no matter what features are enabled or what defines are set. For instance, take these new keycodes which have been added recently to the Wilba, one of the VIA devs, has expressed interest in adding support for all keycodes, even ones that require custom code to do anything useful (eg. Combos and Tap Dance), so it stands to reason the Sequencer would be part of that as well. In that case, the keycodes for this feature must be reorganised so that they do not take into account user preferences. The MIN/MAX defines I would say don't need to be worried about, they are inherently variable and I wouldn't expect VIA to support them. |
Would things be easier if all the MIDI and sequencer keycodes are in a different enum that uses a reserved block of integers well away from |
Fragmenting the enum just makes it harder to figure out which ranges are free. Regarding The issue of non-constancy remains relevant if you are still aiming to support all keycodes. The MIDI section is fine now although VIA cannot know how many octaves the user wants - but all the keycode values are stable. I'm also not sure whether And of course, there is still a big reorganisation of the enum to be done, to reunite things like Magic, Space Cadet and Bluetooth into contiguous blocks. That would probably be the best time to think more carefully about allocation. |
How’s the MIDI section fine? It seems to me that the value of |
Take a look at how The sole purpose of the two defines was to exclude some of these keycodes from the enum - you would set |
Hi, I’m sorry it took so long to reply. I should finally have some time to address the issue. |
Do you know who’s generally maintaining the list of keycodes on VIA’s side? and what’s their process? Is VIA still broken because of my changes last year? Is this software frequently used by people who compile their own layout or is it more used as an alternative for people who don’t have software-engineering skills? |
Sequencer keycodes are now static. |
Nope |
The recent addition of the step sequencer feature in #9703 has introduced a small roadblock in refactoring the Quantum keycode values to be static (ie. removing all the ifdefs in such a way as to not break VIA). The
SQ_S()
,SQ_R()
andSQ_T()
keycodes depend on the values ofSEQUENCER_STEPS
,SEQUENCER_RESOLUTIONS
andSEQUENCER_TRACKS
which can be configured by the user. As such, it is not possible to know exactly what valueSEQUENCER_STEP_MAX
will be, and thus impossible for VIA to support these keycodes. Worse, any new features which add keycodes will be unable to be supported by VIA either, as their values can also not be known.As it turns out, VIA has already been broken by #9940 inserting a new MIDI velocity keycode - although MIDI is not supported by VIA, some of the keycodes are still counted in the enum even if the feature is disabled, and so everything after it is now offset by one. Maybe we should take this opportunity to at least get this ifdef removal done.
@rbelouin would it be possible to refactor the sequencer feature in some way to fix this?
The text was updated successfully, but these errors were encountered: