So I’ve been looking for a decent UI library and decided to give NuclearWinter a look. Unfortunately it seems to have moved from Monogame to FNA a while back and the version at the point where it left doesn’t work with the latest Monogame.
The part that I’ve got to is where its InputManager hooks into some lower level window events, specifically these lines:
System.Reflection.FieldInfo info = typeof(OpenTKGameWindow).GetField( "window",
System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.GetField );
OpenTK.GameWindow window = (OpenTK.GameWindow)info.GetValue( Game.Window );
window.Keyboard.KeyRepeat = true;
window.KeyPress += delegate( object _sender, OpenTK.KeyPressEventArgs _e ) { EnteredText.Add( _e.KeyChar ); };
window.Keyboard.KeyDown += delegate( object _sender, OpenTK.Input.KeyboardKeyEventArgs _e ) { JustPressedOSKeys.Add( _e.Key ); };
window.Keyboard.KeyUp += delegate( object _sender, OpenTK.Input.KeyboardKeyEventArgs _e ) { JustReleasedOSKeys.Add( _e.Key ); };
The immediate problem is that OpenTKGameWindow has had its public modifier removed. The broader problem is that, although I can fork Monogame and change that back, it’s a generally brittle way of going about things. As I’m not that familiar with the ins and outs of the Monogame code I’m wondering if anyone has thoughts/advice on how this should be approached.