opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
physical_key_modifier.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <cstdint>
8
9namespace osc
10{
11 // Represents a single keyboard key modifier, as physically represented
12 // on the keyboard.
13 //
14 // This can be useful to know when (e.g.) showing a user shortcuts or
15 // keybinds, but beware that `PhysicalKeyModifier`s have OS-dependent
16 // intent (e.g. `Ctrl+Z` on Windows/Linux, but `Command+Z` on MacOS),
17 // which is why `KeyModifier` is virtualized in the first place.
19 // No modifier key is pressed.
20 None = 0,
21
22 // A shift key on the keyboard is pressed.
23 Shift = 1<<0,
24
25 // A ctrl key on the keyboard is pressed.
26 Ctrl = 1<<1,
27
28 // A meta (Windows/Command) key on the keyboard is pressed.
29 Meta = 1<<2,
30
31 // An alt key on the keyboard is pressed.
32 Alt = 1<<3,
33
34 NUM_FLAGS = 4,
35 };
37
38 // Converts `KeyModifiers` into `PhysicalKeyModifiers`.
39 template<>
43
44 // Converts `PhysicalKeyModifiers` into `KeyModifiers`.
45 template<>
49}
Definition flags.h:20
Definition custom_decoration_generator.h:5
PhysicalKeyModifier
Definition physical_key_modifier.h:18
constexpr U to(T &&value)
Definition conversion.h:56
PhysicalKeyModifiers operator()(KeyModifiers) const
KeyModifiers operator()(PhysicalKeyModifiers) const
Definition conversion.h:30