How to make CEGUI NOT reset mouse position?

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

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

How to make CEGUI NOT reset mouse position?

Postby agamemnus » Sat Apr 24, 2010 06:50

Using Irrlicht and bootstrap...

Ok, I've searched all over and I can't get neither "CEGUI::System::getSingleton().injectMouseMove(x, y)" nor "CEGUI::MouseCursor::getSingleton().setPosition(CEGUI::Vector2(x, y))" to work properly.

When I use "CEGUI::MouseCursor::getSingleton().setPosition(CEGUI::Vector2(x, y))", nothing happens.

When I use "CEGUI::System::getSingleton().injectMouseMove(x, y)", the mouse does move (sometimes--on the 2nd frame... it's hard to explain everything), but it goes back to previous position the next time CEGUI gets a mouse event from Irrlicht.

Edit: Hold the phone... looks like I can get the Irrlicht mouse position, start the gui, then re-set with the old Irrlicht mouse position. This seems to work but also seems dirty.

Is there any simple way, though, to make CEGUI not reset my mouse coordinates to the center?

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

Re: How to make CEGUI NOT reset mouse position?

Postby CrazyEddie » Mon Apr 26, 2010 09:14

CEGUI does not reset the mouse position; it uses whichever positions come in via the injection interface. If you want to use the injection interface directly, then it's probably not a good idea to be calling the Irrlicht event pusher as well.

One other thing to check is that the mouse constraint area is correct - either by setting the display size with System::notifyDisplaySizeChanged or by setting it directly with MouseCursor::setConstraintArea

CE.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: How to make CEGUI NOT reset mouse position?

Postby agamemnus » Tue Apr 27, 2010 22:21

>CEGUI does not reset the mouse position; it uses whichever positions come in via the injection interface. If you want to use the injection interface directly, then it's probably not a good idea to be calling the Irrlicht event pusher as well.

Before I send any events to CEGUI, it resets the mouse position to the center of the screen on the bootstrap call.

>"One other thing to check is that the mouse constraint area is correct - either by setting the display size with System::notifyDisplaySizeChanged or by setting it directly with MouseCursor::setConstraintArea"

It seems correct..

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

Re: How to make CEGUI NOT reset mouse position?

Postby CrazyEddie » Wed Apr 28, 2010 13:51

Yes. it sets it's own mouse position to the centre of the host window, one time only. It does not reset this at any other point in time.

CE.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: How to make CEGUI NOT reset mouse position?

Postby agamemnus » Wed Apr 28, 2010 19:30

Well, I would like to make it so that it does not reset the position. Maybe you could add it as an option, please? :wink:

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

Re: How to make CEGUI NOT reset mouse position?

Postby CrazyEddie » Thu Apr 29, 2010 09:25

I will add a feature request ticket. Since we can't leave the position of the CEGUI mouse cursor uninitialised, what I propose is to add a static function to the CEGUI::MouseCursor class that allows client code to pre-initialise the CEGUI mouse position to whatever value they like. Upon instantiation, if the position is already initialised CEGUI will not touch it, otherwise the existing behaviour will prevail.

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 5 guests