FrameWindow click and injectMouseButtonDown return value

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

philvanzu
Just popping in
Just popping in
Posts: 1
Joined: Thu Mar 08, 2007 13:27

FrameWindow click and injectMouseButtonDown return value

Postby philvanzu » Thu Mar 08, 2007 15:24

Hello, I'm currently learning Ogre and Cegui. I started with Ogre 1.2 and Cegui 0.4 because the Ogre tutorials are written for the 1.2 branch and now I'm trying to port the knowledge I gained from it to Ogre 1.4 and Cegui 0.5. Everything works fine so far except one little thing: All the clicks i do over a FrameWindow background arent consumed, though they were in version 0.4.

Here is the injection call:

Code: Select all

bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id )
{
   if(CEGUI::System::getSingleton().injectMouseButtonDown(convertOISMouseButtonToCegui(id)))
   {
      return true;
   }
   // Left mouse button down
   if (id == OIS::MB_Left) doStuff();//do some stuff
   return true;
}


As I understand it, injectMouseButtonDown should return true whenever the mouse is over a visible gui window, and it does work most of the time except if I click on a FrameWindow background, then false is returned by injectMouseButtonDown and the doStuff() part of my code is executed when it shouldn't. If the titlebar or the frame of the framewindow is clicked then false is returned as expected.
It does the same things with the 2 skins I tried (taharez and sleekspace)

I tried a few things with getWindowContainingMouse() and setMousePassThroughEnabled() but didn't find a way to resolve my problem.

Should I look in the xml files to define the correct behavior?

zissakos2
Just popping in
Just popping in
Posts: 3
Joined: Mon May 28, 2007 18:22
Location: Stuttgart, Germany

Postby zissakos2 » Wed May 30, 2007 00:33

Does you happen to have a copy of that skin - Sleekspace? Could you post a link/send it to me please?

Thanks a lot!

DexterHolland
Just popping in
Just popping in
Posts: 3
Joined: Thu May 21, 2009 17:56

Re: FrameWindow click and injectMouseButtonDown return value

Postby DexterHolland » Thu May 21, 2009 17:59

I have exactly the same problem.

I have a Window over my scene, and if I click in the window (even in its background) I can also interact with the 3D objects behind.

And another thing is bugging me: If I have for instance a button in that Window and I click in it too fast, some clicks aren't processed as well.

How do you solve things like this?

Thanks

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: FrameWindow click and injectMouseButtonDown return value

Postby Jamarr » Thu May 21, 2009 20:59

Please read the Forum Guidlines first and try searching for your problem before posting your question. There is already a thread on this topic here: http://www.cegui.org.uk/phpBB2/viewtopic.php?p=16135#p16135.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

DexterHolland
Just popping in
Just popping in
Posts: 3
Joined: Thu May 21, 2009 17:56

Re: FrameWindow click and injectMouseButtonDown return value

Postby DexterHolland » Thu May 21, 2009 23:29

I didn't even create a new post.I placed my question in a reply to another post.

I checked the link you gave me (Thanks by that). Doesn't solve the problem yet, but gives me guides to the problem which by now is something. But that topic is newer that this one, why should it be proprietary? And by the way, sometimes the terms used in searches don't guide us to the wanted topics. My searches were on "injectmouse framewindow", "frame window background click", etc... and I didn't get there.

DexterHolland
Just popping in
Just popping in
Posts: 3
Joined: Thu May 21, 2009 17:56

Re: FrameWindow click and injectMouseButtonDown return value

Postby DexterHolland » Thu May 21, 2009 23:51

So, from what I get.

Since version 0.6 there is an issue that messes a little with the events. (The never ending story of programmers... kill1 bug and then deal with the 100 that came for the funeral).

The frame window background doesn't react by itself to the mouse clicks so process the mouse pressed event for it just returning true and it'll work.

The quick mouse presses is really a cegui noob question... If I'm only handling single clicks I should set setWantsMultiClickEvents to false, so every mouse pressed input is an independent one.

And everything is working.... by now.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests