simulate user click?

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

phoenixy
Just popping in
Just popping in
Posts: 14
Joined: Tue Feb 27, 2007 01:18

simulate user click?

Postby phoenixy » Mon Jul 23, 2007 22:31

I want to make an automated test for game.
What i want to do is, to simulate mouse click on some windows.

Of course, I can generate mouse events at Windows API level, but then it's hard to control which window(CEGUI) to click.

Is there any way to specify a CEGUI window and generate mouse click event?

CEGUI::Window::OnMouse*** events are all protected so I can't directly call them.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Jul 24, 2007 07:38

Hi,

automated testing = interesting stuff :)

What you could do is fake a mouse move with the 'injectMousePosition()' call. As you might know, cegui doesn't listen to input itself so this is not hacky or something. It always works like this.

Let's say you want to 'click' your Help button. You could lookup the window, get its screen area (getUnclippedRect()) IIRC, set the mouse at the center and call 'InjecMouseButtonDown()'. All input calls can be found here:
http://www.cegui.org.uk/wiki/index.php/ ... ing_Inputs

HTH.
Last edited by scriptkid on Wed Jul 25, 2007 12:27, edited 1 time in total.

phoenixy
Just popping in
Just popping in
Posts: 14
Joined: Tue Feb 27, 2007 01:18

Postby phoenixy » Tue Jul 24, 2007 18:25

Thanks a lot!
It was really helpful :)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 7 guests