This is a little utility I wrote to allow me to use my Belkin Nostromo with Minecraft. With a little work, this can be adapted to other devices.
In order to do this, it actually reads in Minecraft's options file for its keys. Compatible with technic and spoutcraft launchers. In fact, it will read in the option file of the last modpack you played, reloading a new one when you change modpacks.