Skip to main content

cursor_blink_timer_callback

Function cursor_blink_timer_callback 

Source
pub extern "C" fn cursor_blink_timer_callback(
    _data: RefAny,
    info: TimerCallbackInfo,
) -> TimerCallbackReturn
Expand description

Callback for the cursor blink timer

This function is called every ~530ms to toggle cursor visibility. It checks if enough time has passed since the last user input before blinking, to avoid blinking while the user is actively typing.

The callback returns:

  • TerminateTimer::Continue + Update::RefreshDom if cursor toggled
  • TerminateTimer::Terminate if focus is no longer on a contenteditable element