This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can i read coordinates from connected target through HID?

Hi, all.

I want read mouse cursor coordinates from connected target(PC or iPhone and so on) through HID. And then, i want to align the mouse cursor in the target center.

If i can read coordinate from target, i think it can easy align the mouse cursor.

•chip : nRf51822

•example version/name : nRF_Example 10.0.0 / ble_app_hids_mouse

"ble_app_hids_mouse" example can just moving mouse cursor through button. (->I conformed it.)

Please let me know some guide.

  • Hi,

    Short answer: There is not any HID standard to read cursor position, and some platforms (including iOS) do not even support a cursor.

    Longer answer:

    The HID standard allows for information to be sent from the host to the HID device, but sending cursor position requires defining a custom (non-standard) HID report as well as providing drivers for the host to use the custom report.

    Regarding iOS there are some projects providing a cursor (which may or may not require jailbreaking the device), but I do not know much about them.

    Mice movement can be reported using one of two modes: relative or absolute. The most common method is relative, which means that each report contains the relative movement since the last report was sent. This means you have little to no control over absolute position of the cursor on the host. To complicate matters the host usually implements mouse acceleration, which means a relative movement of 200 units will lead to varying distance travelled for the cursor depending on the speed of the movement. While virtually all platforms supports relative mode, not all platforms supports absolute mode.

    Regards, Terje

  • Hi, Terje.

    Thanks your kindly comment and related knowledge.

    I'm understood to be impossible in the HID standard.

    Thank you.

Related