From 8c3be740b956f50b04b9945a17240bb87d696056 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 2 Jan 2026 15:32:41 -0500 Subject: [PATCH] feat: expose keyboard shortcuts to AT-SPI --- platforms/atspi-common/src/node.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/platforms/atspi-common/src/node.rs b/platforms/atspi-common/src/node.rs index 33aa2279..887f92cb 100644 --- a/platforms/atspi-common/src/node.rs +++ b/platforms/atspi-common/src/node.rs @@ -382,6 +382,10 @@ impl NodeWrapper<'_> { self.0.braille_role_description() } + fn keyboard_shortcut(&self) -> Option<&str> { + self.0.data().keyboard_shortcut() + } + fn attributes(&self) -> HashMap<&'static str, String> { let mut attributes = HashMap::new(); if let Some(placeholder) = self.placeholder() { @@ -399,6 +403,9 @@ impl NodeWrapper<'_> { if let Some(role_description) = self.braille_role_description() { attributes.insert("brailleroledescription", role_description.to_string()); } + if let Some(shortcut) = self.keyboard_shortcut() { + attributes.insert("keyshortcuts", shortcut.to_string()); + } attributes } @@ -959,7 +966,12 @@ impl PlatformNode { actions.push(AtspiAction { localized_name: wrapper.get_action_name(i as i32), description: "".into(), - key_binding: "".into(), + // The keyboard shortcut is for the default action (index 0) + key_binding: if i == 0 { + wrapper.keyboard_shortcut().unwrap_or_default().into() + } else { + "".into() + }, }); } Ok(actions)