Input 2.0

More intuitive and consistent input.

A follow up to Event Driven Input for XNA on the PC.

I have been working on a new library that is meant to be an easy, cross platform plug and play library that provides event driven input. It includes improvements to my windows hook discussed earlier, after polishing it up I modified the Starbound Input library with the goal of making it behave identically.

Improvements

The below are what has been improved in the latest version of the library vs the old version.

Handling system keys and differentiating between left and right modifier keys.

virtualKey = (Keys)(extended ? VirtualKeys.RCONTROL : VirtualKeys.LCONTROL);  

Altering the mouse wheel information to be consistent with what is returned by Mouse.GetState() and keeps track of the total Delta.

if (MouseWheel != null)  
{
    var delta = (wparam >> 16) / 120;
    _totalDelta += delta;
    short x, y;
    MouseLocationFromLParam(lparam, out x, out y);
    MouseWheel(null, new WMouseEventArgs(x, y, MouseButton.None, 0, _totalDelta, delta));
}

Cross Platform

The cross platform library is based upon the Starbound Input project with a lot of work put into making it as consistent with Windows event queue processor as possible. The idea being the input will be as intuitive as possible.

There are multiple bug fixes for issues I found in the Starbound issue and I also made it so that the definition of a character is the same and the modifiers are handled identically.

While the code is cross platform with whatever works with XNA I need to work on making the adoption process easier for MonoGame and FNA. If you have any ideas on how to do please contact me or point me in the right direction.

comments powered by Disqus