diff options
author | Victor Berger <victor.berger@m4x.org> | 2015-12-13 15:13:23 +0100 |
---|---|---|
committer | Victor Berger <victor.berger@m4x.org> | 2015-12-22 14:36:41 +0100 |
commit | 84f1aef100c5f60cfb9086ca872cbf274092696c (patch) | |
tree | d286b3fca09bf9bef9d1872d942f7403a1edca70 /src/api/wayland/events.rs | |
parent | 0792557f4bc05125f0181729a6adbaf1aa52ec27 (diff) | |
download | glutin-84f1aef100c5f60cfb9086ca872cbf274092696c.tar.gz glutin-84f1aef100c5f60cfb9086ca872cbf274092696c.zip |
api/wayland: add keyboard support.
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 |