Work-in-progress patch for non-exclusive input in tools/demo


25-01-2011 06:03:51

Find it inconvenient that LayoutManager captures the mouse input and stops you from using other applications while you're using it? So did I!

Included is a work-in-progress patch that will cause the mouse to be grabbed in exclusive mode under Linux *only* when running fullscreen for the included MyGUI apps. If run in windowed mode, it won't ask for the mouse or keyboard in exclusive mode, and leaves key-repeat alone. This means that if you run LayoutEditor (etc) in windowed mode you can easily switch back-and-forth between other apps.

It is a work-in-progress patch for the following reasons:

- I've only changed the behaviour for the general OIS code (ie. not WIn32 or WIn32_OIS) and Ogre combinations thus far. Other combinations could be made to work in the future.

- I think that basing it off whether you are in fullscreen mode or not is the right idea, but I'm not certain.

- I've included some extra code in the general OIS InputManager that (hopefully!) works properly with Windows. Whether the code belongs there or not depends on the longer-term plans with respect to this directory and the Win32_OIS directory. It might make sense to remove it, or leave it there. I've left it in as it's easier to remove code than to add code. :)

- My text editor is messing up the comments in some of the files (eg. "InputManager.cpp" in "Win32_OIS") that need editing. Because I can't speak Russian (I assume it's Russian?) I don't know what it is doing to the comments. This means I had to use sed to edit these files, and it's really slow. ;)

- I want to make sure the MyGUI devs are happy with the way I've done it before I proceed further. :)

However, even in its current form, I've found the patch to be very helpful. :)

EDIT: Patch is against a recently subversion checkout, so I wouldn't expect it to work with anything pre-3.2.0, but you never know. ;)


25-01-2011 07:13:49

Hmm... just noticed something under Linux at least with non-exclusive mode: The mouse plays up a bit near the edges sometimes. This could impact things a bit.