ttx 0.1.0
Loading...
Searching...
No Matches
modifiers.h
Go to the documentation of this file.
1#pragma once
2
3#include "di/reflect/enumerator.h"
4#include "di/reflect/reflect.h"
5#include "di/util/bitwise_enum.h"
6
7// Key reference: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
8namespace ttx {
9enum class Modifiers {
10 None = 0,
11 Shift = 1 << 0,
12 Alt = 1 << 1,
13 Control = 1 << 2,
14 Super = 1 << 3,
15 Hyper = 1 << 4,
16 Meta = 1 << 5,
17 CapsLock = 1 << 6,
18 NumLock = 1 << 7,
20};
21
22DI_DEFINE_ENUM_BITWISE_OPERATIONS(Modifiers)
23
24constexpr auto tag_invoke(di::Tag<di::reflect>, di::InPlaceType<Modifiers>) {
25 using enum Modifiers;
26 return di::make_enumerators<"Modifiers">(
27 di::enumerator<"None", None>, di::enumerator<"Shift", Shift>, di::enumerator<"Alt", Alt>,
28 di::enumerator<"Control", Control>, di::enumerator<"Super", Super>, di::enumerator<"Hyper", Hyper>,
29 di::enumerator<"Meta", Meta>, di::enumerator<"CapsLock", CapsLock>, di::enumerator<"NumsLock", NumLock>);
30}
31}
Definition cursor_style.h:5
Modifiers
Definition modifiers.h:9
@ Super
Definition modifiers.h:14
@ Hyper
Definition modifiers.h:15
@ LockModifiers
Definition modifiers.h:19
@ Shift
Definition modifiers.h:11
@ Control
Definition modifiers.h:13
@ Alt
Definition modifiers.h:12
@ Meta
Definition modifiers.h:16
@ None
Definition direction.h:8
@ CapsLock
Definition key.h:77
@ NumLock
Definition key.h:79
constexpr auto tag_invoke(di::Tag< di::reflect >, di::InPlaceType< CursorStyle >)
Definition cursor_style.h:16