Skip to main content
Visitor II
October 26, 2020
Question

How to change the resolution of USB HID mouse

  • October 26, 2020
  • 2 replies
  • 1878 views

I am using STM32f3 discovery kit with STM32 cube ide to interface the kit as USB HID mouse. I am trying to change the resolution of the mouse. The default resolution given in the Report descriptor is 400 dpi . (0x15, 0x81,     //   LOGICAL_MINIMUM (-127)- 0x81

  0x25, 0x7f,     //   LOGICAL_MAXIMUM (127)- 0x7f

It is possible to change the value of the report descriptor to increase the resolution of the USB HID mouse.

    This topic has been closed for replies.

    2 replies

    HKhan.2Author
    Visitor II
    November 3, 2020

    @Community member​ Please can you give any tips on this problem

    Graduate II
    November 3, 2020

    Not really a USB/HID expert. Check that the endian order is correct, that the descriptor has right number of bytes, checksums, etc.​

    HKhan.2Author
    Visitor II
    November 4, 2020

    The endian order is correct.

    uint8_t mousebuffer[4];

    mousebuffer[0]=0; // Left and right click (0: None, 1: Left click, 2: Right Click

     mousebuffer[1]=0; // X movement 0:, not moving, +ve : Right movement ,-ve :left movement

     mousebuffer[2]=0; // Y movement 0: not moving ,+ve : Down movement ,-ve :up movement

     mousebuffer[3]=0; // Scroll 0: not moving ,+ve : Up movement, -ve :Down movement

    USBD_HID_SendReport(&hUsbDeviceFS,mousebuffer,4);

    The mousebuffer declaration is uint8_t which limit the range to -127 to 127 for max. and min. value of the x axis and y axis movement of the mouse which is also specified in the report descriptor . I want to define the mouse buffer to uint16_t to increase the range of x and y movement which will increase the resolution of the USB HID mouse . I tried to change the defination in the USB library but could not get any solution.

    Can the hardware support this changes on the library to increase the resolution of the USB HID mouse??

    HKhan.2Author
    Visitor II
    November 4, 2020

    @Yohann M.​  Please can you give any tips on this problem