1
\$\begingroup\$

I've just switched over to MonoGame from XNA. Since MonoGame is supposed to have the same API (implying that any copied code should work as usual), I've run into a strange issue- input doesn't seem to be handled through MonoGame.

When I tried to fix any missing "using" directives in that class, it automatically added using Microsoft.Xna.Framework.Input which implies that there's no MonoGame equivalent.

Googling the issue had no success- all the tutorials I found for MonoGame said to use XNA's input.

Is there a MonoGame equivalent for handling input, or do I just need to use XNA for that?

\$\endgroup\$
2
\$\begingroup\$

MonoGame intentionally uses the same namespaces as XNA as required to make it a drop in replacement.

For Example look at the MonoGame VS2010 Template

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

The using Microsoft.Xna.Framework.Input uses MonoGame if Monogame is included as a reference; alternatively, it uses XNA if XNA is included as a reference. If you have both frameworks referenced it would throw an error and force you to disambiguate.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.