| 1 | // LAF OS Library |
| 2 | // Copyright (C) 2017 David Capello |
| 3 | // |
| 4 | // This file is released under the terms of the MIT license. |
| 5 | // Read LICENSE.txt for more information. |
| 6 | |
| 7 | #ifndef OS_SHORTCUT_H_INCLUDED |
| 8 | #define OS_SHORTCUT_H_INCLUDED |
| 9 | #pragma once |
| 10 | |
| 11 | #include "os/keys.h" |
| 12 | |
| 13 | namespace os { |
| 14 | |
| 15 | class Shortcut { |
| 16 | public: |
| 17 | Shortcut(int unicode = 0, |
| 18 | KeyModifiers modifiers = kKeyNoneModifier) |
| 19 | : m_unicode(unicode) |
| 20 | , m_modifiers(modifiers) { |
| 21 | } |
| 22 | |
| 23 | int unicode() const { return m_unicode; } |
| 24 | KeyModifiers modifiers() const { return m_modifiers; } |
| 25 | |
| 26 | bool isEmpty() const { return m_unicode == 0; } |
| 27 | |
| 28 | private: |
| 29 | int m_unicode; |
| 30 | KeyModifiers m_modifiers; |
| 31 | }; |
| 32 | |
| 33 | } // namespace os |
| 34 | |
| 35 | #endif |
| 36 | |