2

So unity obviously has its Cursor.SetCursor() method to allow you to set a custom cursor... however, what about a GetCursor method? There is no such thing in the public API, it seems.

On a normal project, the obvious solution would be to just wrap the SetCursor method with something, and keep track of all requests for a cursor from there. However, in this case here I don't have that option. I'm trying to implement a mod for a game, so I don't actually have direct access to the main unity assembly, just API access to it. All the cursor-changing stuff is happening under the hood from my mod dll.

Hence the question. Does anybody know if there is a way to find out what the current cursor in use is?


For more context, what I'm trying to do is to make a mod so I can force games to use software cursors. Ideally, I'd watch for any changes to the cursor, and make a new one after it with the force-software-cursor option set, using the same texture.

This is to sidestep a longstanding issue with the Steam controller and steam streaming, which causes an intolerable amount of mouse lag. I found that software cursors don't have that issue, so I decided to take matters into my own hands. (because you know I have all this free time and all :P )

Many thanks in advance for any ideas, suggestions and brainfarts.

Cheers

General Grievance
  • 4,555
  • 31
  • 31
  • 45
HarvesteR
  • 175
  • 1
  • 8
  • 1
    You would need to implement an OS-specific solution for all OS you want to support. I believe [this thread](https://stackoverflow.com/questions/46891775/how-to-get-current-cursor-as-texture2d-unity-c-sharp) should help you get started. I do not know of anything built-in that does what you would like to achieve. Another [useful link](https://www.codeproject.com/Questions/420774/get-the-as-mouse-cursor-image) on window's API to grab cursor images. It will not be fun. – TEEBQNE May 29 '21 at 01:03
  • I've removed the Unity tag from your question title, as per this site's ragging guidelines. – ProgrammingLlama May 29 '21 at 02:42

0 Answers0