Example script is misleading
After I installed m2i through PKGBUILD, I modified the example script at /usr/share/m2i a bit so that it ignores velocity and mapped it to middle C. When I tried it, instead of space as mentioned in the script, I got key press d instead. I thought my Arch Linux installation is broken until I found this issue: #52 (closed) and it turns out that m2i doesn't use xinput, but used uinput. But the default script still refers to X11 keycodes:
--[[ Defines ]]--
-- look to X11\keysymdef.h for the full list
XK_space = 0x0020 --/* U+0020 SPACE */
which is correct for X11 keycode, but uinput uses kernel keycodes: https://github.com/torvalds/linux/blob/master/include/uapi/linux/input-event-codes.h , where 0x20 is KEY_D in kernel keycode and XK_space in X11 keycode
My suggestion is to edit the example script so it refers to kernel keycodes instead of X11 keycodes so that it works as expected