From ba9137d1f10e8f2364e2621e46b054101b715294 Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Mon, 12 Aug 2024 19:16:33 -0400 Subject: [PATCH] wayland: keyboard: skip adding unavailable keys to the keymap Keys are unsupported if they have no name, or if xkeysym uses a different format for their name (e.g. XF86Fn). Skip key symbols that have no name and can't be added to the text keymap. To support this, set the availability of each keysym before updating the keymap. --- src/core/button.rs | 2 +- src/wayland/keyboard.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/button.rs b/src/core/button.rs index b76889c..fcf4361 100644 --- a/src/core/button.rs +++ b/src/core/button.rs @@ -169,8 +169,8 @@ impl Button { mut layout: Layout, mut kbd: K, gfx: Arc>>) -> Button { - kbd.change_layout(&layout); layout.update_keys_supported(&kbd); + kbd.change_layout(&layout); Button { layout, diff --git a/src/wayland/keyboard.rs b/src/wayland/keyboard.rs index 228c4b4..d9b8254 100644 --- a/src/wayland/keyboard.rs +++ b/src/wayland/keyboard.rs @@ -225,7 +225,7 @@ impl Keyboard for VirtualKeyboard { for row in layout.rows() { for key in row { for part in &key.parts { - if part.sym() == Keysym::NoSymbol || part.sym() == Keysym::XF86_Fn { + if !part.key_available() { continue; }