:right-sidebar: True EventControllerFocus =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: EventControllerFocus(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.EventController`, :class:`~gi.repository.GObject.Object` ``GtkEventControllerFocus`` is an event controller to keep track of keyboard focus. The event controller offers :obj:`~gi.repository.Gtk.EventControllerFocus.signals.enter` and :obj:`~gi.repository.Gtk.EventControllerFocus.signals.leave` signals, as well as :obj:`~gi.repository.Gtk.EventControllerFocus.props.is_focus` and :obj:`~gi.repository.Gtk.EventControllerFocus.props.contains_focus` properties which are updated to reflect focus changes inside the widget hierarchy that is rooted at the controllers widget. Constructors ------------ .. rst-class:: interim-class .. class:: EventControllerFocus :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.EventController Creates a new event controller that will handle focus events. Methods ------- .. rst-class:: interim-class .. class:: EventControllerFocus :no-index: .. method:: contains_focus() -> bool Returns :const:`True` if focus is within ``self`` or one of its children. .. method:: is_focus() -> bool Returns :const:`True` if focus is within ``self``\, but not one of its children. Properties ---------- .. rst-class:: interim-class .. class:: EventControllerFocus :no-index: .. attribute:: props.contains_focus :type: bool The type of the None singleton. .. attribute:: props.is_focus :type: bool The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: EventControllerFocus.signals :no-index: .. method:: enter() -> None The type of the None singleton. .. method:: leave() -> None The type of the None singleton.