WIP. feat(kscan): Add Hall keyscan driver
Hall sensors introduce a new dimension to keyboards. It's easier to list the things you can’t do without them than the things you can, because they have almost unlimited applications: accessibility, gaming, and high-tech devices, to name a few. So let ZMK support them.
This PR is still under development. There's a lot of work to be done. Everyone can contribute and help speed up progress.
TODO:
- [x] Basic input (ADC, base settings, EMA, limits & normalization)
- [x] Support different polarity switches (Outemu, Haimu, etc.).
- [ ] Behaviors
- [ ] Dynamic (10%: &kp A; 20%: &kp B; etc). Almost done
- [ ] Rapid trigger
- [ ] Variable output
- [ ] Multi ADC input (e.g. &adc from the MCU and several &mcp3204)
- [ ] Docs
- [ ] ZMK Studio
- [ ] Display widget
Setup
Donor board: SayoDevice O3C board: nice nano v2 shield: custom Sensor: AH49E (datasheet)
Rate my setup btw
The next step requires modifications outside of the driver. ~~I'm not sure, but I think the best option is to create a new event to signal sensor changes immediately after zmk_keycode_state_changed.~~
The input_report() function was exactly what I needed.
related: https://github.com/zmkfirmware/zmk/issues/2096
I think I would recommend to make this a module similar to https://github.com/petejohanson/ec-support-zmk-module/tree/main for the time being. I don't foresee the capacity to properly review and consider this for addition anytime soon, considering the backlog of PRs, and growing the number of hall effect keyboards running ZMK in the meantime would be good justification for the future.
I think I would recommend to make this a module similar to https://github.com/petejohanson/ec-support-zmk-module/tree/main for the time being. I don't foresee the capacity to properly review and consider this for addition anytime soon, considering the backlog of PRs, and growing the number of hall effect keyboards running ZMK in the meantime would be good justification for the future.
Yeah, sure. Would you mind if I continued making progress here for now and then moved all the changes to a separate repository?
Proceed as you wish, I merely wanted to give a heads up about timeline and provide a reasonable alternative as a suggestion.
If it can be of any help, I've created a module that supports HE switches (for now only direct-wired) and most of the features commonly found on analog keyboards. It's certainly not ready for a final product (the data flow and configuration is quite convoluted) but it could help to implement something directly in zmk. zmk-feature-hall-effect
I'm not presently in a position to contribute directly but wanted to say how happy I am to see this work being done!