Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

As a preliminary solution, I am currently using the Nuclex framework in an C#/XNA game project for buffered keyboard input. Sadly, nuclex relies on SlimDX.Directinput.dll and therefore to my knowledge can only be used under Windows OSs. However, I use MonoGame to target other platforms (Linux, OSX, etc.) and therfore I am looking for a portable way to integrate buffered keyboard input aross all platforms. Is there any?

share|improve this question
    
Doesn't exist as a library yet. People have done it for Mac and Linux when porting my gui library to monogame and I am trying to get people to contribute their code. –  ClassicThunder Apr 7 '13 at 23:04

2 Answers 2

SharpInputSystem was created for this exact purpose. It provides a portable way of access the Keyboard and Mouse on most platforms and GamePad/Joystick on a few others. In full disclosure, I am the author, but I needed a similar library for the samples I provide with Axiom.

It may need to be modified to load the MonoGame assemblies properly, I am currently loading the Xna libraries dynamically to avoid a dependency on a strong name. I can either look into making those changes if you want or if you feel up to it, submit a patch once you've got it working.

share|improve this answer
1  
Good effort but not a real answer since it's not usable at this point without significant work. –  ashes999 Mar 8 '13 at 23:50

While not properly portable (it is only for Windows and Linux). MonoGame has an event for text input that uses properly buffered keyboard input.

MonoGame.Framework/GameWindow.cs

    /// Use this event to retrieve text for objects like textbox's.
    /// This event is not raised by noncharacter keys.
    /// This event also supports key repeat.
    /// For more information this event is based off:
    /// http://msdn.microsoft.com/en-AU/library/system.windows.forms.control.keypress.aspx
    /// </summary>
    /// <remarks>
    /// This event is only supported on the Windows DirectX, Windows OpenGL and Linux platforms.
    /// </remarks>
    public event EventHandler<TextInputEventArgs> TextInput;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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