0

I'm currently developing a 3D viewer application in WPF, and for ergonomy reasons I want my mouse to go to the other border of the screen if it goes into one.

For example, if my mouse goes into the top screen border, set I set my mouse position to the bottom of my screen. Same for left/right.

How can I actually detect my mouse position in WPF? The only position I can get is related to the software and not the entire screen.

Also, it would be great if it could support dual monitors. (So the mouse is re-set only if it goes into the second monitor)

Adrien Neveu
  • 827
  • 1
  • 15
  • 28

1 Answers1

0

based on the informative answers to the s.o. question here:

How do I get the current mouse screen coordinates in WPF?

I think the simpler way to go is the windows.forms method, unless your 3d graphics are updating a lot of computation and you don't want the extra .net unboxed loop performance margin hit. According to this msdn reference:

http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position.aspx

the Cursor.Position property is settable, so should be settable from WPF app, although you want to do some research and testing before committing to a lot of code on that

Community
  • 1
  • 1
stackuser83
  • 2,012
  • 1
  • 24
  • 41