setAutoRepeatRate - not working for me!

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

LearnerPlates
Just popping in
Just popping in
Posts: 20
Joined: Mon Jun 08, 2009 06:05

setAutoRepeatRate - not working for me!

Postby LearnerPlates » Wed Oct 14, 2009 04:51

Me again - thanks for helping me out with all my little queries. :)

I'm having trouble setting the autorepeat rate for a button - no matter what value I give to setAutoRepeatRate(), it doesn't seem to be having any effect. I'm injecting a time pulse into CEGUI with each frame update as follows:

Code: Select all

CEGUI::System::getSingleton().injectTimePulse(evt.timeSinceLastFrame);


And setting the autorepeat on my CEGUI::PushButton* like so:

Code: Select all

btnVolumeUp->subscribeEvent(CEGUI::Window::EventMouseButtonDown, CEGUI::Event::Subscriber(&UserInterface::btnVolumeUpClick, this));
btnVolumeUp->setMouseAutoRepeatEnabled( true );
btnVolumeUp->setAutoRepeatDelay(1.0f);
btnVolumeUp->setAutoRepeatRate(1.0f);


The autorepeat works just fine - but it is ridiculously fast, no matter what value I put into setAutoRepeatRate. Am I missing something here?

LearnerPlates
Just popping in
Just popping in
Posts: 20
Joined: Mon Jun 08, 2009 06:05

Re: setAutoRepeatRate - not working for me!

Postby LearnerPlates » Wed Oct 14, 2009 06:32

Hmm, something odd - if I take out the injectTimePulse() line, the autorepeat still works! Is there something else that could be interfering here?

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

Re: setAutoRepeatRate - not working for me!

Postby CrazyEddie » Wed Oct 14, 2009 09:25

Are you calling Window::update on some window somewhere? If so, don't! :P

CE.

LearnerPlates
Just popping in
Just popping in
Posts: 20
Joined: Mon Jun 08, 2009 06:05

Re: setAutoRepeatRate - not working for me!

Postby LearnerPlates » Wed Oct 14, 2009 11:03

No, I'm not. :(

Could it be something to do with how I'm injecting mouse input into CEGUI? This is handled by another section of the program (not under my control - it's a team project), and I think

Code: Select all

CEGUI::System::getSingleton().injectMouseButtonDown( CEGUI::LeftButton )
is called every frame that the mouse button is down. Might that cause problems?

Something is definitely odd here - the autorepeat is happening even when I insert the line

Code: Select all

pBtnMusicUp->setMouseAutoRepeatEnabled( false );

in place of setting it to "true". :shock:

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

Re: setAutoRepeatRate - not working for me!

Postby CrazyEddie » Wed Oct 14, 2009 13:36

LearnerPlates wrote:I think

Code: Select all

CEGUI::System::getSingleton().injectMouseButtonDown( CEGUI::LeftButton )
is called every frame that the mouse button is down. Might that cause problems?

Yes, this is almost certainly the issue. Doing this is not recommended at all, and is definitely not any use that we intended.

CE.

LearnerPlates
Just popping in
Just popping in
Posts: 20
Joined: Mon Jun 08, 2009 06:05

Re: setAutoRepeatRate - not working for me!

Postby LearnerPlates » Fri Oct 16, 2009 06:15

Thanks for confirming, CE - I'll see what I can do to get that fixed!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 21 guests