pub struct InputDispatcher {
pub pointers: ObjectRefSet<Pointer>,
pub v5_pointers: ObjectRefSet<Pointer>,
pub relative_pointers: ObjectRefSet<RelativePointer>,
pub keyboards: ObjectRefSet<Keyboard>,
pub touches: ObjectRefSet<Touch>,
pub pointer_focus: Option<ObjectRef<Surface>>,
pub keyboard_focus: Option<ObjectRef<Surface>>,
pub keyboard_focus_source: Option<ObjectRef<Surface>>,
/* private fields */
}
Fields§
§pointers: ObjectRefSet<Pointer>
The set of bound wl_pointer objects for this client.
Note we’re assuming a single wl_seat for now, so these all are pointers associated with that seat.
v5_pointers: ObjectRefSet<Pointer>
§relative_pointers: ObjectRefSet<RelativePointer>
The set of bound zwp_relative_pointer objects for this client.
Note we’re assuming a single wl_seat for now, so these all are relative pointers associated with that seat.
keyboards: ObjectRefSet<Keyboard>
The set of bound wl_pointer objects for this client.
Note we’re assuming a single wl_seat for now, so these all are keyboards associated with that seat.
touches: ObjectRefSet<Touch>
The set of bound wl_pointer objects for this client.
Note we’re assuming a single wl_seat for now, so these all are touches associated with that seat.
pointer_focus: Option<ObjectRef<Surface>>
The current surface that has been advertised to have pointer focus.
keyboard_focus: Option<ObjectRef<Surface>>
The current surface that has been advertised to have keyboard focus.
keyboard_focus_source: Option<ObjectRef<Surface>>
The current surface that is the source for incoming keyboard events. This is the surface associated with the view that the native input pipeline has given focus. This is different from the above field as it will not change when we determine that a child view should have focus.
Implementations§
Source§impl InputDispatcher
impl InputDispatcher
Sourcepub fn has_focus(&self, surface_ref: ObjectRef<Surface>) -> bool
pub fn has_focus(&self, surface_ref: ObjectRef<Surface>) -> bool
Returns true iff the given surface currently has keyboard focus.
Sourcepub fn clear_focus_on_surface_destroy(&mut self, surface: ObjectRef<Surface>)
pub fn clear_focus_on_surface_destroy(&mut self, surface: ObjectRef<Surface>)
Updates focus state in response to a surface being unmapped.
Since a new surface may be created with the same object id as surface
,
we need to ensure our current focus is cleared so we can send new focus
enter events for the new surface. This does not send focus leave
events as these are implicit with the surface being destroyed.
This has no effect if the surface being destroyed has no focus.
Source§impl InputDispatcher
impl InputDispatcher
pub fn new(event_queue: EventQueue) -> Self
pub fn handle_key_event( &mut self, source: ObjectRef<Surface>, event: &KeyEvent, ) -> Result<(), Error>
Sourcepub fn send_keymap_event(&mut self, keymap_vmo: Vmo) -> Result<()>
pub fn send_keymap_event(&mut self, keymap_vmo: Vmo) -> Result<()>
Dispatches a keymap change event to all attached keyboards.