[Solved] fire MouseEvent

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Dirso
Not too shy to talk
Not too shy to talk
Posts: 25
Joined: Sun Dec 31, 2006 15:49

[Solved] fire MouseEvent

Postby Dirso » Sat May 05, 2007 16:33

Hi,

When the mouse enters a button, I'm setting the focus to this button and I would like this buttons react to keyboard input, for example, if I press <<Enter>> it should act like left click mouse event:

Code: Select all

bool keyReleased( const CEGUI::EventArgs& e )
{
   // what should i put here to fire left click event?
   return true;
}


Thanks,
Dirso
Last edited by Dirso on Sat May 05, 2007 20:13, edited 1 time in total.

User avatar
Levia
Quite a regular
Quite a regular
Posts: 83
Joined: Mon May 22, 2006 18:25
Location: Bergen op zoom, The Netherlands
Contact:

Postby Levia » Sat May 05, 2007 17:06

Code: Select all

CEGUI::EventArgs e;
button->fireEvent(CEGUI::Window::EventMouseClick, e);

Thats how you fire an event manually. The method works, but I'm not sure the event works (so im not sure the button will be pushed then, though you could always fire PushButton::EventClicked, which will work)

Code: Select all

CEGUI::EventArgs e;
button->fireEvent(CEGUI::PushButton::EventClicked, e);
Image
Image


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 21 guests