3

I'm using Monogame to develop an universal app for Windows Store and Windows Phone.

I know that is possible to check if a TouchPanel is available and I'm looking for a method that do the same thing with a mouse.

I can't ignore the fact that a mouse is not connected because instructions like this.IsMouseVisible = true; launch exceptions on Windows Phone.

Thank you all for your reply,

Luca.

lukemols
  • 71
  • 2
  • 11

1 Answers1

1

You have various solutions, depends of what you want to do :

  1. You can add a try-catch around this.IsMouseVisible. If you get a exception, you know for sure that the mouse is unavailable.
  2. You have conditional compilation symbols with XNA. Use #if !WINDOWS_PHONE to prevent phones to check the mouse. I think you can consider that most of phones don't use mouse. (See MSDN documentation)
ReMinoer
  • 402
  • 3
  • 11