From b8ac9d3472e9c1813a16d7a50d4dfa50106d73a0 Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Wed, 2 Jul 2025 00:31:55 -0400 Subject: [PATCH] Add alt-d shortcut to select address bar text (#37794) I usually use the alt-d in shortcut in Firefox to select the text in the address bar. Firefox supports both alt-d and ctrl-l. This change adds the alt-d shortcut so you can use either. Testing: I tested it by running Servo and pressing alt-d. I don't know if there is a way to create a test for it? --------- Signed-off-by: Michael Mc Donnell --- ports/servoshell/desktop/minibrowser.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/servoshell/desktop/minibrowser.rs b/ports/servoshell/desktop/minibrowser.rs index dcdd4ad94b2..46957fdde05 100644 --- a/ports/servoshell/desktop/minibrowser.rs +++ b/ports/servoshell/desktop/minibrowser.rs @@ -331,8 +331,14 @@ impl Minibrowser { if location_field.changed() { location_dirty.set(true); } + // Handle adddress bar shortcut. if ui.input(|i| { - i.clone().consume_key(Modifiers::COMMAND, Key::L) + if cfg!(target_os = "macos") { + i.clone().consume_key(Modifiers::COMMAND, Key::L) + } else { + i.clone().consume_key(Modifiers::COMMAND, Key::L) || + i.clone().consume_key(Modifiers::ALT, Key::D) + } }) { location_field.request_focus(); if let Some(mut state) =