FocusHandler (interface)

December 20, 2016 ยท View on GitHub

API categories | API index

FocusHandler (interface)

Implement this interface to handle events related to focus. The methods of this class will be called on the UI thread.

Table of contents:

Callbacks

OnTakeFocus

ParameterType
browserBrowser
next_componentbool
Returnvoid

Description from upstream CEF:

Called when the browser component is about to loose focus. For instance, if focus was on the last HTML element and the user pressed the TAB key. |next| will be true if the browser is giving focus to the next component and false if the browser is giving focus to the previous component.

OnSetFocus

ParameterType
browserBrowser
sourcecef_focus_source_t
Returnbool

Description from upstream CEF:

Called when the browser component is requesting focus. |source| indicates where the focus request is originating from. Return false to allow the focus to be set or true to cancel setting the focus.

The cef_focus_source_t enum constants in the cefpython module:

  • FOCUS_SOURCE_NAVIGATION (The source is explicit navigation via the API (LoadURL(), etc))
  • FOCUS_SOURCE_SYSTEM (The source is a system-generated focus event)

OnGotFocus

ParameterType
browserBrowser
Returnvoid

Description from upstream CEF:

Called when the browser component has received focus.