From daeddc4c6f8382d2cae7a97bd3cb800f38ce8f96 Mon Sep 17 00:00:00 2001 From: Andrew Mackenzie Date: Thu, 14 Jul 2016 23:23:58 +0100 Subject: [PATCH] Add a keyboard shortcut (Command + Q on Mac or Control + Q on other OS) to Quit the app directly. Fixes #12422 --- ports/glutin/window.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/glutin/window.rs b/ports/glutin/window.rs index 54fd6e56b49..4e154a5f677 100644 --- a/ports/glutin/window.rs +++ b/ports/glutin/window.rs @@ -917,6 +917,11 @@ impl WindowMethods for Window { self.event_queue.borrow_mut().push(WindowEvent::Reload); } } + (CMD_OR_CONTROL, Some('q'), _) => { + if let Some(true) = PREFS.get("shell.builtin-key-shortcuts.enabled").as_boolean() { + self.event_queue.borrow_mut().push(WindowEvent::Quit); + } + } _ => { self.platform_handle_key(key, mods);