I have a module written using XNA which polls the GamePad and the Keyboard on a background thread, and calls some callbacks. No Game class whatsoever.
I want to use this module from a WPF application, calling Dispatcher.BeginInvoke on the callback, and makeing some changes on the display (which contains no TextBox, etc), based on the callbacks parameters.
It works perfectly with the GamePad, but the Keyboard.GetState().GetPressedKeys() array is always empty!
I think it has something to do with WPF message loop catching the keyboard events before I can poll them in XNA, or there is nothing for xna to set the keyboard focus to.
Do you have any tips? How to pass keyboard state to XNA, so I don't have to rewrite the keyboard handling using WPF classes?