-
-
Notifications
You must be signed in to change notification settings - Fork 98
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 handling of button release events for Octavi devices #1627
Add handling of button release events for Octavi devices #1627
Conversation
While working on this code I've noticed some other behaviour which doesn't seem correct to me:
|
ButtonPress = OctaviButtonMatrix.ElementAt(ButtonPress).Value; // translate to existing Octavi "devices" in MF | ||
if (ButtonPress >= 0) ButtonPresses.Add(ButtonPress); // if not "unassigned" (-1), then press the button! | ||
int lookupIndex = extendedContextState * 16 + HidEventAssignments[button]; // find "full matrix" event index | ||
int buttonIndex = OctaviButtonMatrix.ElementAt(lookupIndex).Value; // translate to existing Octavi "devices" in MF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OctaviButtonMatrix is a Dictionary which has no guaranteed order. Using ElementAt is not really the correct way to do this.
I would also like to suggest a renaming of the AP buttons like so, to better represent their actual functions and the Octavi hardware:
This would obviously break exisiting configuration though. Not sure how big of a deal that is? |
don't mix any renaming and the initial scope of release events Felix has to chime in on the renaming so make a separate PR for that |
I've created Issue #1642 for this. I think I should hold off on creating a PR until this one is finalised otherwise it will create merge issues. |
…stion Co-authored-by: Neil Enns <neile@live.com>
Co-authored-by: Neil Enns <neile@live.com>
…enamed local variables to correct casing
…etc for enums to give stronger typing and clearer code.
…"Button_NAV1_CRSR", "Button_NAV2_CRSR", "Button_XPDR_CRSR ". Also removal of Shift mode for AP context.
cd0b425
to
63ac017
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Looks a lot cleaner now.
foreach(uint HIDEvent in HIDEventAssignments.Keys) | ||
|
||
// Encoders | ||
// TODO: Should we add RELEASE events for the encoders too? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no release events for encoders.
Build for this pull request: |
Fixes Issue #1626