From b05078b610c79c59322b38d42cabc4eb5ec7280b Mon Sep 17 00:00:00 2001 From: Aatos Majava Date: Thu, 24 Jun 2021 18:09:41 +0300 Subject: [PATCH] LibGUI: Add a new constructor to Action This constructor allows you to omit the modifier keys. Instead of doing "{ 0, Key_F5 }" you can now just do "Key_F5" --- Userland/Libraries/LibGUI/Shortcut.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibGUI/Shortcut.h b/Userland/Libraries/LibGUI/Shortcut.h index ec7f51333d..5563f7f857 100644 --- a/Userland/Libraries/LibGUI/Shortcut.h +++ b/Userland/Libraries/LibGUI/Shortcut.h @@ -19,6 +19,11 @@ public: , m_key(key) { } + Shortcut(KeyCode key) + : m_modifiers(0) + , m_key(key) + { + } bool is_valid() const { return m_key != KeyCode::Key_Invalid; } u8 modifiers() const { return m_modifiers; }