xjjak / LapCal

Building gloves that enable typing on a 34-key keyboard without an actual physical keyboard using IMUs and machine learning.
Other
2 stars 0 forks source link

[PLAN] Key logger for data collection #30

Closed xjjak closed 3 months ago

xjjak commented 5 months ago

We need a keylogger for our keyboards. This would enable easier collection of larger datasets, which would also be less unbalanced and more realistic.

Possible approaches:

We tried using the keycodes sent by the keyboard, making it completely device-side. This was not very successful. It should be attempted to utilize the QMK firmware, possibly with custom code snippets to make collection easier or even on the keyboards themselves. This could be done by sending key numbers through a separate channel, similar to something described in this article under Firmware.

xjjak commented 4 months ago

To add key logging output to my keyboard with the following additions/modifications on to of the tutorial:

xjjak commented 4 months ago

The plan now is to write a simple script the output of hid_listen can be piped into, which prepends the current Unix timestamp. A format changing "filter" can be applied to the whole file afterward if necessary for compatibility with the current training method.

xjjak commented 4 months ago

For the HID console, the QMK udev rules from qmk_fimware/utils/udev/50-qmk.rules must be copied to lib/udev/rules.d or that directory in its corresponding location.

xjjak commented 3 months ago

To mitigate the effect that a press event was only sent after a hold-event was detected when a key was kept pressed, the modified function was changed to pre_process_user_record(). Thanks, @palisn, for figuring that out.