aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/gui/Keyboard.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-09 22:34:50 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-09 22:34:50 +0800
commitfee3a550f00f6df4b341ca6ed47ef7e9a748a9ba (patch)
tree88c4584eb92523ee15dceae79237070f7f8bedf5 /include/cru/platform/gui/Keyboard.h
parent20fc1e5595e4f498d297c09934dbfcc005982f54 (diff)
downloadcru-fee3a550f00f6df4b341ca6ed47ef7e9a748a9ba.tar.gz
cru-fee3a550f00f6df4b341ca6ed47ef7e9a748a9ba.tar.bz2
cru-fee3a550f00f6df4b341ca6ed47ef7e9a748a9ba.zip
Implement xcb keyboard.
Diffstat (limited to 'include/cru/platform/gui/Keyboard.h')
-rw-r--r--include/cru/platform/gui/Keyboard.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/cru/platform/gui/Keyboard.h b/include/cru/platform/gui/Keyboard.h
index 224aea04..eb1cc76e 100644
--- a/include/cru/platform/gui/Keyboard.h
+++ b/include/cru/platform/gui/Keyboard.h
@@ -2,9 +2,6 @@
#include "cru/base/Bitmask.h"
#include "cru/platform/gui/Base.h"
-#include <string>
-#include <string_view>
-
namespace cru::platform::gui {
// Because of the complexity of keyboard layout, I only add code in US keyboard
// layout, the most widely used layout in China. We should try to make it easy
@@ -126,6 +123,11 @@ struct KeyModifiers {
static constexpr KeyModifier ctrl{0b10};
static constexpr KeyModifier alt{0b100};
static constexpr KeyModifier command{0b1000};
+ static constexpr KeyModifier None = KeyModifier::FromOffset(0);
+ static constexpr KeyModifier Shift = KeyModifier::FromOffset(1);
+ static constexpr KeyModifier Ctrl = KeyModifier::FromOffset(2);
+ static constexpr KeyModifier Alt = KeyModifier::FromOffset(3);
+ static constexpr KeyModifier Command = KeyModifier::FromOffset(4);
};
#ifdef CRU_PLATFORM_OSX