cubemx de usb hid olarak ayarlarsanız windows mouse olarak tanıyor, daha sonra usbdesc den değiştirip klavye vsvs ayarlanabiliyor
bende mouse ile uğraşırken bu aklıma geldi
https://www.youtube.com/watch?v=5fHhlCsD9Sc
(http://www.devreci.com/stm32_mouse_touchpad.jpg)
http://www.devreci.com/stm32_mouse_touchpad.rar