HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
keyboard_state.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7namespace hi::inline v1 {
8
9enum class keyboard_state : uint8_t {
10 idle = 0x00,
11 caps_lock = 0x01,
12 scroll_lock = 0x02,
13 num_lock = 0x04,
14};
15
16[[nodiscard]] constexpr keyboard_state operator|(keyboard_state const& lhs, keyboard_state const& rhs) noexcept
17{
18 return static_cast<keyboard_state>(to_underlying(lhs) | to_underlying(rhs));
19}
20
21[[nodiscard]] constexpr keyboard_state operator&(keyboard_state const& lhs, keyboard_state const& rhs) noexcept
22{
23 return static_cast<keyboard_state>(to_underlying(lhs) & to_underlying(rhs));
24}
25
26constexpr keyboard_state& operator|=(keyboard_state& lhs, keyboard_state const& rhs) noexcept
27{
28 return lhs = lhs | rhs;
29}
30
31bool operator>=(keyboard_state const& lhs, keyboard_state const& rhs) = delete;
32
33[[nodiscard]] constexpr bool to_bool(keyboard_state const& rhs) noexcept
34{
35 return to_bool(to_underlying(rhs));
36}
37
38}
DOXYGEN BUG.
Definition algorithm.hpp:13
T operator>=(T... args)