I actually know how to do this off the top of my head and you don’t need to write a driver for it, you could simply use an Arduino Micro.
The Micro (and other Arduino-compatible Atmel ATMEGA 32u4-based microcontrollers) have native USB support so they have a library you can import that will work with generic USB keyboard/mouse drivers. It would be up to you to rig up the sensors and buttons, make a case and write a little firmware.