From 7ff88280f3fa16d7bb7fafb3672bd1ab0a61293d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 15 Apr 2023 15:00:03 -0700 Subject: [PATCH] keyboard fixup build on x11/wayland --- window/src/os/wayland/inputhandler.rs | 2 ++ window/src/os/x11/keyboard.rs | 2 +- window/src/os/x11/window.rs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/window/src/os/wayland/inputhandler.rs b/window/src/os/wayland/inputhandler.rs index 72e1a5c48..6ebd91780 100644 --- a/window/src/os/wayland/inputhandler.rs +++ b/window/src/os/wayland/inputhandler.rs @@ -14,6 +14,7 @@ use wayland_protocols::unstable::text_input::v3::client::zwp_text_input_manager_ use wayland_protocols::unstable::text_input::v3::client::zwp_text_input_v3::{ Event, ZwpTextInputV3, }; +use wezterm_input_types::KeyboardLedStatus; #[derive(Default, Debug)] struct PendingState { @@ -60,6 +61,7 @@ impl Inner { conn.dispatch_to_focused_window(WindowEvent::KeyEvent(KeyEvent { key: KeyCode::composed(&text), modifiers: Modifiers::NONE, + leds: KeyboardLedStatus::empty(), repeat_count: 1, key_is_down: true, raw: None, diff --git a/window/src/os/x11/keyboard.rs b/window/src/os/x11/keyboard.rs index ca113487b..d0dce58cc 100644 --- a/window/src/os/x11/keyboard.rs +++ b/window/src/os/x11/keyboard.rs @@ -9,7 +9,7 @@ use std::cell::RefCell; use std::collections::HashMap; use std::ffi::{CStr, OsStr}; use std::os::unix::ffi::OsStrExt; -use wezterm_input_types::PhysKeyCode; +use wezterm_input_types::{KeyboardLedStatus, PhysKeyCode}; use xkb::compose::Status as ComposeStatus; use xkbcommon::xkb; diff --git a/window/src/os/x11/window.rs b/window/src/os/x11/window.rs index 33ba4ab6b..42f17da32 100644 --- a/window/src/os/x11/window.rs +++ b/window/src/os/x11/window.rs @@ -20,7 +20,7 @@ use std::convert::TryInto; use std::rc::{Rc, Weak}; use std::sync::{Arc, Mutex}; use wezterm_font::FontConfiguration; -use wezterm_input_types::{KeyCode, KeyEvent, Modifiers}; +use wezterm_input_types::{KeyCode, KeyEvent, KeyboardLedStatus, Modifiers}; use xcb::x::{Atom, PropMode}; use xcb::{Event, Xid}; @@ -633,6 +633,7 @@ impl XWindowInner { pub fn dispatch_ime_text(&mut self, text: &str) { let key_event = KeyEvent { key: KeyCode::Composed(text.into()), + leds: KeyboardLedStatus::empty(), modifiers: Modifiers::NONE, repeat_count: 1, key_is_down: true,