PDA

View Full Version : Update Event Frequency



Nickademus
September 25th, 2015, 03:12
I was glancing through the Ruleset Reference and noticed something that brings up a question.

I'm sure there are other events like this, but for the sake of example, the windowcontrol element has an event called onHoverUpdate. "This function is called when the mouse cursor is moved while over the control." If I understand this correctly, it fires as long as the mouse is moving and hasn't left the area of the control. My question is, how often does this event fire off? If I have a large windowcontrol and am just moving the mouse cursor back and forth, does is the event called every second? Or 30 times a second? Or 60 times a second? Or every processor click? I'm curious.

Moon Wizard
September 27th, 2015, 07:04
It's based on how often the mouse is moving and how much processing that FG is currently doing. Basically, every time that the application asks Windows for the next UI event message, it will provide a mouse movement message if the mouse has moved. FG asks for the next UI event in between handling drawing and networking code. It's most likely about equivalent to frame rate while the mouse is moving (since drawing usually is triggered on mouse moves).

For detail on each control, FG calculates all the controls and windows over which the mouse is hovering (until it reaches the first non-embedded window), and all of these embedded windows/controls receive the hover update events if defined.

Cheers,
JPG

Nickademus
September 27th, 2015, 07:30
So FG doesn't cap it and it relies on Windows: roughly frame rate. Good to know. Thanks.