Handles keys fine but not mouse

TriggerB

08-11-2007 21:20:44

I'm injecting mouse input with:

bool mouseMoved( const MouseEvent &arg ) {

QuickGUI::GUIManager::getSingleton().injectMouseMove(arg.state.X.rel, arg.state.Y.rel );


return true;
}


and butto injection with a similar function.

A watch on arg.state.y.rel without injecting to QuickGUI reveals that it is working fine.

If I comment out my movement injection, and just do button injection it will run fine until I click, then it will break out of the window and bring me to :

bool MouseCursor::isVisible()
{
return mVisible;
}


in quickguimousecursor.cpp

If I comment out buttons and just do movement, it will break out to:


bool MouseCursor::mouseOnTopBorder()
{
return mOnTopBorder;
}


Everything will run fine until I do the action that im injecting.

Keyboard input works alright aswell.

Any ideas?

Thanks

kungfoomasta

08-11-2007 21:43:29

Does the demo behave correctly? What version are you using?

In my team's project we use the NON EXCLUSIVE input for the mouse, to make use of the OS cursor. To match the OS cursor with the Software (QuickGUI) cursor, we do the following:

In your mouseMoved callback:
QuickGUI::GUIManager::getSingleton().injectMousePosition(arg.state.X.abs, arg.state.Y.abs );

Providing the stack traces for the crashes might help me figure out whats going on.

[edit]
Looking at the areas that the app is crashing, i would guess MouseCursor is NULL. Make sure you are setting up QuickGUI correctly.

1. Make the call to "QuickGUI::registerConfigParser" before initializing your resources.

2. Call QuickGUI::SkinSetManager::getSingleton().createSkin(...);

3. Make sure you create QuickGUI with a valid viewport.

4. Make sure to call GUIManager::setSceneManager(...) so that the cursor and other widgets get rendered properly.
[/edit]

Let me know if that helps!

TriggerB

09-11-2007 19:24:26

Thanks for the help. I tried for hours to get it working but it wouldnt budge. The release I had did not have some of the functions you mentioned so I updated to the latest SVN rev. I couldn't find registerConfigParser(), I think you mean registerScriptParser().

Though the demo compiled fine it would not run without an Ogre sharedptr error so I messed with it and eventually fixed it. I believe it was related to resource locations.

Updated my code to comply with the SVN and it finally worked. I had some trouble with createSkin() though, just pulled the code from the demo and it was fine.

Now I can finally get my GUI working! :P

Thanks again

kungfoomasta

09-11-2007 20:08:12

Awesome, good to hear its working!

You're probably right about registerScriptParser, I don't have the code off hand, so my function names may not be very accurate at times.