2

I am trying DigiMouse library for attiny85 Digispark board.

It allows to emulate the mouse quite well. However, I also need to know the current cursor position. Is there a way to get it?

asked Sep 19, 2019 at 17:08
1
  • 1
    emulate an "absolute position" mouse ... regular mouse only sends "relative move" values Commented Sep 19, 2019 at 17:48

1 Answer 1

1

There is no way for a mouse of any kind (especially not one as minimal as DigiMouse.h) to know the current cursor position - USB just doesn't provide that kind of facility.

Instead you need to implement an "absolute" mouse (aka a "tablet"). However DigiMouse doesn't implement such a facility. So you would have to implement your own tablet driver.

A normal mouse sends a "delta" for the position. That is, a difference in position from whatever the current position is. An absolute mouse, or tablet, sends the position on the screen as a proportion of some maximum set of dimensions. Ideally that would be the same dimensions as your screen, but doesn't have to be.

The main differences between DigiMouse and whatever you would implement for a DigiTablet would be the "HID Report Descriptor". This defines what the data that is sent means and how the computer should interpret it.

answered Sep 19, 2019 at 19:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.