Intercept events from a keyboard (like the FS1-P foot pedal) and output another key instead, using uinput.
This only works on Linux.
-
Debug:
mkdir build cd build cmake -DCMAKE_BUILD_TYPE="Debug" .. cmake --build .
-
Release:
mkdir build cd build cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_FLAGS="-s" .. cmake --build .
./interceptkb [KEY_CODE] [INPUT_PATH]
For example, to output the left meta (Windows) key from the FS1-P foot pedal:
./interceptkb 125 dev/input/by-id/usb-RDing_FootSwitch1F1.-event-kbd
See here for a list of input event codes.