-
Notifications
You must be signed in to change notification settings - Fork 258
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
allow one GPIO pin to trigger 2+ buttons #724
base: main
Are you sure you want to change the base?
allow one GPIO pin to trigger 2+ buttons #724
Conversation
Is this all ready to review? |
38eafc2
to
10728dd
Compare
10728dd
to
8610486
Compare
33607b1
to
5212bfb
Compare
f6f64f6
to
a2f6705
Compare
Confirmed this is working, going to have some other eyes on the UI as well. |
Thats good! Please ping me if the UI is not good enough for the first iteration, if so i will try to merge the new page with pin mapping page. |
80da6f2
to
7ad1872
Compare
before it returned just the actions, which was fine, but now we're adding more stuff to the infos, so return the whole struct rather than just the GpioAction within it
this expands GpioMappingInfo to include dpad and button masks and uses those masks when setting up the button maps in Gamepad. this allows for a GPIO pin to trigger any arbitrary set of buttons
* remove double initialization of gamepad GPIOs * have getProfilePinMappings return whole GpioMappingInfos before it returned just the actions, which was fine, but now we're adding more stuff to the infos, so return the whole struct rather than just the GpioAction within it * define a custom button combo to a GPIO pin this expands GpioMappingInfo to include dpad and button masks and uses those masks when setting up the button maps in Gamepad. this allows for a GPIO pin to trigger any arbitrary set of buttons * Add a WIP multi mapping page * have getProfilePinMappings return whole GpioMappingInfos before it returned just the actions, which was fine, but now we're adding more stuff to the infos, so return the whole struct rather than just the GpioAction within it * define a custom button combo to a GPIO pin this expands GpioMappingInfo to include dpad and button masks and uses those masks when setting up the button maps in Gamepad. this allows for a GPIO pin to trigger any arbitrary set of buttons * implement get/setPinMappingsV2 which includes the new masks * Start moving to new payload structure, new endpoint, translation keys * Set action if mask is set * Multi-mapping route added to webconfig, start adding customDpadMask * Revert endpoint test for v2 * fix issue where setPinMappingsV2 was actually ignoring input * Rename BUTTON_MASK -> BUTTON_MASK_OPTIONS to prepare for multi mapping data * Removed some unused imports * Add support for dpad mask * Add text for assigned to multi mapping on pin mapping page * Add support for swapping button labels * Update pins after setting multi pin * Set correct default in multi mapping, disables selection on non selectable actions
I probably introduced this in a bad rebase
b7bf11b
to
c4a3c78
Compare
Marked this a draft again, since we are saving it for after 0.7.8, and there has been a desire for and already some experimentation around a better UI/UX --- ideally a single page and a fancier selection/modal thing or something. |
This adds a couple protobuf fields to the
GpioMappingInfo
structure to include dpad and button masks and uses them when setting up theGamepad
object to allow a pin to be the trigger for more than one button. All the cost is at setup time, so this shouldn't have any material effect on gamepad performance.As usual, @Pelsin helped my proto-brain (pun intended) with the UI work. It will need improvement/expansion in the future, but this works for now.