Kiwano Engine v1.3.x
Keys.h
1// Copyright (c) 2016-2018 Kiwano - Nomango
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21#pragma once
22#include <kiwano/macros.h>
23
24namespace kiwano
25{
28enum class MouseButton
29{
30 Left,
31 Right,
32 Middle,
33
34 Last
35};
36
39enum class KeyCode
40{
41 Unknown,
42 Up,
43 Left,
44 Right,
45 Down,
46 Enter,
47 Space,
48 Esc,
49 Ctrl,
50 Shift,
51 Alt,
52 Tab,
53 Delete,
54 Back,
55 Super,
56
57 A,
58 B,
59 C,
60 D,
61 E,
62 F,
63 G,
64 H,
65 I,
66 J,
67 K,
68 L,
69 M,
70 N,
71 O,
72 P,
73 Q,
74 R,
75 S,
76 T,
77 U,
78 V,
79 W,
80 X,
81 Y,
82 Z,
83
84 Num0,
85 Num1,
86 Num2,
87 Num3,
88 Num4,
89 Num5,
90 Num6,
91 Num7,
92 Num8,
93 Num9,
94
95 Numpad0,
96 Numpad1,
97 Numpad2,
98 Numpad3,
99 Numpad4,
100 Numpad5,
101 Numpad6,
102 Numpad7,
103 Numpad8,
104 Numpad9,
105
106 F1,
107 F2,
108 F3,
109 F4,
110 F5,
111 F6,
112 F7,
113 F8,
114 F9,
115 F10,
116 F11,
117 F12,
118
119 Last
120};
121
122inline KeyCode operator+(KeyCode lhs, int rhs) noexcept
123{
124 return KeyCode(int(lhs) + rhs);
125}
126
127inline KeyCode operator-(KeyCode lhs, int rhs) noexcept
128{
129 return KeyCode(int(lhs) - rhs);
130}
131
132inline KeyCode operator+(int lhs, KeyCode rhs) noexcept
133{
134 return KeyCode(lhs + int(rhs));
135}
136
137inline KeyCode operator-(int lhs, KeyCode rhs) noexcept
138{
139 return KeyCode(lhs - int(rhs));
140}
141
142inline int operator-(KeyCode lhs, KeyCode rhs) noexcept
143{
144 return int(lhs) - int(rhs);
145}
146
147} // namespace kiwano