qmk_xap
qmk_xap copied to clipboard
[Feature] Add user functionality
Description
Litle code allowing users to develop custom logic.
-
Parse incoming user-level(
id==3
) XAP broadcast messages (receive info from the keyboard) and generate events to be handled by user. Un-populatedstruct
representing the message's content to be filled by user -
Hooks for
- Handling custom messages
- Pre init
- On exit
- New device
- Device disconnected
- Housekeeping (run every 0.5 seconds)
These currently are just empty placeholder functions within
user.rs
-
UserData
struct so custom data can be stored/used on user's functions. In the same way asUserBroadcast
, the specific implementation is left as an exercise to the reader
Extra: Some minor refactors due to cargo fmt
PS: Haven't tested this particular code further than seeing it compiles, but my fork's code (which is way more complex) works, so this one should too... Unless i forgot copying some small piece