diff options
Diffstat (limited to 'src/api/wayland/events.rs')
-rw-r--r-- | src/api/wayland/events.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/api/wayland/events.rs b/src/api/wayland/events.rs index 6a7a2e7..8aeddac 100644 --- a/src/api/wayland/events.rs +++ b/src/api/wayland/events.rs @@ -12,6 +12,8 @@ use wayland_client::wayland::seat::{WlSeat, WlSeatEvent, WlPointerEvent, WlPointerButtonState, WlPointerAxis, WlSeatCapability}; +use super::wayland_kbd::MappedKeyboard; + use super::context::WaylandFocuses; pub fn translate_event( @@ -29,6 +31,16 @@ pub fn translate_event( focuses.pointer = Some(seat.get_pointer()); } } + if cap.contains(WlSeatCapability::Keyboard) && focuses.keyboard.is_none() { + if let Some(seat) = seat { + match MappedKeyboard::new(seat) { + Ok(mk) => { + focuses.keyboard = Some(mk) + }, + Err(_) => {} + } + } + } None }, _ => None |