Loss of MouseButton input after closing and reopening game.

Started by
-1 comments, last by drelidan7 11 years, 10 months ago
[font=lucida sans unicode,lucida grande,sans-serif]Hello. I am currently working on a very small scale game engine and am running into an issue when I close and reopen my game from my primary application.[/font]

[font=lucida sans unicode,lucida grande,sans-serif]My InputManager initialization code:[/font]

[font=lucida sans unicode,lucida grande,sans-serif]
[/font]
[font=lucida sans unicode,lucida grande,sans-serif]public InputManager(Game game)[/font]
[font=lucida sans unicode,lucida grande,sans-serif] : base(game)[/font]
[font=lucida sans unicode,lucida grande,sans-serif] {[/font]
[font=lucida sans unicode,lucida grande,sans-serif] [/font]
[font=lucida sans unicode,lucida grande,sans-serif] Device.RegisterDevice(UsagePage.Generic, UsageId.Mouse, DeviceFlags.None, game.Form.Handle);[/font]

[font=lucida sans unicode,lucida grande,sans-serif] Device.MouseInput += new EventHandler<MouseInputEventArgs>(Device_MouseInput);[/font]
[font=lucida sans unicode,lucida grande,sans-serif] }[/font]
[font=lucida sans unicode,lucida grande,sans-serif][/quote][/font]

[font=lucida sans unicode,lucida grande,sans-serif]The first time my InputManager is instantiated, everything works fine. The second (and I would imagine subsequent, though I haven't checked) time the InputManager is instantiated, the Device.MouseInput event never gets fired on button clicks, and the ButtonState is always marked as None.[/font]

[font=lucida sans unicode,lucida grande,sans-serif]I am running the game in a slightly odd environment. The primary application is a C#/WPF application, but one of our screens was suffering from a severe performance bottleneck, so we decided to implement it using SlimDX. My Game will be created and destroyed several times throughout the day, while the host application will remain running for eight to ten hours [working in a clinical environment]. It's not reasonable to ask our users to restart the application between game sessions.[/font]

Has anyone encountered anything like this before? Or does anyone know where I could look for help?

Thanks,

This topic is closed to new replies.

Advertisement