Skip to content
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

feat(core): Optionally disable automatic endpoint fallback #2572

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ReFil
Copy link
Contributor

@ReFil ReFil commented Oct 19, 2024

By default if only one endpoint is connected but the other is selected, the connected endpoint will be chosen as a fallback, for boards with physical endpoint selection slide switches this can lead to confusing behaviour where one is selected but the other is used.

This adds a kConfig option CONFIG_ZMK_ENDPOINT_DISABLE_FALLBACK that, when enabled, switches the board to a different endpoint selection system that will only return the preferred transport or anew transport ZMK_TRANSPORT_NONE that just swallows any HID data.

Tested with various combinations of USB and BLE and it seems to work as intended

@ReFil ReFil requested review from a team as code owners October 19, 2024 16:00
@caksoylar
Copy link
Contributor

Can we add a link to https://zmk.dev/docs/keymaps/behaviors/outputs pointing to this? Perhaps an additional paragraph at the end of the summary section.

app/src/endpoints.c Outdated Show resolved Hide resolved
app/src/endpoints.c Outdated Show resolved Hide resolved
app/src/endpoints.c Outdated Show resolved Hide resolved
app/include/zmk/endpoints.h Outdated Show resolved Hide resolved
app/src/endpoints.c Outdated Show resolved Hide resolved
app/src/endpoints.c Outdated Show resolved Hide resolved
app/src/endpoints.c Outdated Show resolved Hide resolved
Copy link
Collaborator

@joelspadin joelspadin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed one more issue. Otherwise, this looks good to me (though I haven't personally tested it).

@ReFil
Copy link
Contributor Author

ReFil commented Oct 26, 2024

@joelspadin sorry to be a pain, not sure if GitHub is playing up or something but I can't seem to see what changes you requested?

app/src/endpoints.c Outdated Show resolved Hide resolved
@joelspadin
Copy link
Collaborator

@joelspadin sorry to be a pain, not sure if GitHub is playing up or something but I can't seem to see what changes you requested?

No idea where that comment went. I've added it again.

@caksoylar caksoylar added core Core functionality/behavior of ZMK bluetooth Bluetooth related items usb labels Oct 27, 2024
Copy link
Collaborator

@joelspadin joelspadin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me now, but @petejohanson should probably take a look too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bluetooth Bluetooth related items core Core functionality/behavior of ZMK usb
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants