Thebluefish
28-01-2013 01:31:47
I've found a bug that I've been trying to fix for the past 2-3 hours now, and I think I've isolated it down to MyGUI. Whenever the window loses focus (switching to another app, alt+tab,etc...) and then I open the main window back up, all of the widgets do not respond to input. This includes keypress, mouse press, hovering, etc... I've verified that OIS is sending the inputs correctly, and even the MyGUI cursor behaves normally, though while I can move the cursor, I must click in the render window before I am able to control any widgets. Any help would be appreciated.
Right now I'm running in VS2010 on Windows 8.
Edit: Debugging some more gives me a bit of insight as to what's happening. Clicking on the title bar or task bar generates a mousePressed event but no mouseReleased event. This is causing MyGUI to think that a widget has control of the mouse. So this is an OIS issue, not a MyGUI issue. My bad!
Temporarily, I've been able to resolve this by adding a function to MyGUI that exposes the mMouseCapture list. When a mouseMoved or mousePressed event is fired, I compare the internal state of all mouse buttons against their current state. If MyGUI thinks they're pressed when they really aren't, I first fire off a mouseReleased event, then fire off whatever actual event is going to happen. Probably tomorrow I'm going to add a couple of checks-and-balances to my OIS wrapper to do this for all mouse and keyboard events so that it's being done on the input level vs the MyGUI level.
Right now I'm running in VS2010 on Windows 8.
Edit: Debugging some more gives me a bit of insight as to what's happening. Clicking on the title bar or task bar generates a mousePressed event but no mouseReleased event. This is causing MyGUI to think that a widget has control of the mouse. So this is an OIS issue, not a MyGUI issue. My bad!
Temporarily, I've been able to resolve this by adding a function to MyGUI that exposes the mMouseCapture list. When a mouseMoved or mousePressed event is fired, I compare the internal state of all mouse buttons against their current state. If MyGUI thinks they're pressed when they really aren't, I first fire off a mouseReleased event, then fire off whatever actual event is going to happen. Probably tomorrow I'm going to add a couple of checks-and-balances to my OIS wrapper to do this for all mouse and keyboard events so that it's being done on the input level vs the MyGUI level.