Root window clicks?

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

gamecoder4
Just popping in
Just popping in
Posts: 10
Joined: Tue Feb 09, 2010 20:40

Root window clicks?

Postby gamecoder4 » Sun Feb 21, 2010 18:56

Hi
how can i find out when the user clicks the very root window?

i was trying this:

Code: Select all

Window* main = dynamic_cast<Window*>(winMgr.getWindow("editor"));

main->subscribeEvent(Window::EventMouseMove, Event::Subscriber(editorMouseMove));

but the EventArgs holds wierd data so I thought this must not be used this way?

Version : 0.7.1

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Root window clicks?

Postby CrazyEddie » Sun Feb 21, 2010 19:36

Hi,

Code looks fine to me. So I have to ask, what do you mean by weird data in the EventArgs?

Btw, WindowManager::getWindow already returns a WIndow* so your cast there is somewhat superfluous ;)

CE.

gamecoder4
Just popping in
Just popping in
Posts: 10
Joined: Tue Feb 09, 2010 20:40

Re: Root window clicks?

Postby gamecoder4 » Sun Feb 21, 2010 19:48

hi CE

well i have function like this:

Code: Select all

bool editorMouseMove(const CEGUI::EventArgs& e)
{
 const MouseEventArgs &me = static_cast<const MouseEventArgs&>(e);

// me.button

if(me.sysKeys == 1) // left click
{
}

}


but me.button never has correct MouseButton::LeftButton etc but only NoButton.
and if(me.sysKeys == 1) // left click, seems to work but only like 95% the time.....

so am i supposed to go with me.sysKeys ? :)
i was just wondering if im using thing the right way...

gamecoder4
Just popping in
Just popping in
Posts: 10
Joined: Tue Feb 09, 2010 20:40

Re: Root window clicks?

Postby gamecoder4 » Sun Feb 21, 2010 20:08

oh i found this was needed :
if(me.sysKeys & SystemKey::LeftMouse) instead of: if(me.sysKeys == 1)

thx! solved now

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Root window clicks?

Postby CrazyEddie » Mon Feb 22, 2010 08:31

awesome :lol:


Return to “Help”

Who is online

Users browsing this forum: No registered users and 27 guests