while possible it is certainly not the easiest way to solve your problem.
easier solutions:
-buy a keyboard with extra buttons meant to map macros to
-map your macros to "shift+f-key", that gives you 12. "ctrl+shift+f-key" gives you 24. this would have to be done in the program itself unless your software for the keyboard handles macros.
-use a gamepad (the ones that look like small keyboards). i'm sure you can manage to map the keys to functions but those functions might need a different keypress combination (mapped to one key with the macro) than typical in a progam.
so theres a few options out there... you could do as you wished but it would be alot of work for someone who doesnt seem to be familiar with creating such devices.