PeriDyno 1.0.0
Loading...
Searching...
No Matches
Keys.h
Go to the documentation of this file.
1/*
2* Key codes for multiple platforms
3*
4* Copyright (C) 2016 by Sascha Willems - www.saschawillems.de
5*
6* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
7*/
8
9#pragma once
10
11#if defined(_WIN32)
12#define KEY_ESCAPE VK_ESCAPE
13#define KEY_F1 VK_F1
14#define KEY_F2 VK_F2
15#define KEY_F3 VK_F3
16#define KEY_F4 VK_F4
17#define KEY_F5 VK_F5
18#define KEY_W 0x57
19#define KEY_A 0x41
20#define KEY_S 0x53
21#define KEY_D 0x44
22#define KEY_P 0x50
23#define KEY_SPACE 0x20
24#define KEY_KPADD 0x6B
25#define KEY_KPSUB 0x6D
26#define KEY_B 0x42
27#define KEY_F 0x46
28#define KEY_L 0x4C
29#define KEY_N 0x4E
30#define KEY_O 0x4F
31#define KEY_T 0x54
32
33#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
34#define GAMEPAD_BUTTON_A 0x1000
35#define GAMEPAD_BUTTON_B 0x1001
36#define GAMEPAD_BUTTON_X 0x1002
37#define GAMEPAD_BUTTON_Y 0x1003
38#define GAMEPAD_BUTTON_L1 0x1004
39#define GAMEPAD_BUTTON_R1 0x1005
40#define GAMEPAD_BUTTON_START 0x1006
41#define TOUCH_DOUBLE_TAP 0x1100
42
43#elif defined(VK_USE_PLATFORM_IOS_MVK)
44// Use numeric keys instead of function keys.
45// Use main keyboard plus/minus instead of keypad plus/minus
46// Use Delete key instead of Escape key.
47#define KEY_ESCAPE 0x33
48#define KEY_F1 '1'
49#define KEY_F2 '2'
50#define KEY_F3 '3'
51#define KEY_F4 '4'
52#define KEY_W 'w'
53#define KEY_A 'a'
54#define KEY_S 's'
55#define KEY_D 'd'
56#define KEY_P 'p'
57#define KEY_SPACE ' '
58#define KEY_KPADD '+'
59#define KEY_KPSUB '-'
60#define KEY_B 'b'
61#define KEY_F 'f'
62#define KEY_L 'l'
63#define KEY_N 'n'
64#define KEY_O 'o'
65#define KEY_T 't'
66
67#elif defined(VK_USE_PLATFORM_MACOS_MVK)
68// For compatibility with iOS UX and absent keypad on MacBook:
69// - Use numeric keys instead of function keys
70// - Use main keyboard plus/minus instead of keypad plus/minus
71// - Use Delete key instead of Escape key
72#define KEY_ESCAPE 0x33
73#define KEY_F1 0x12
74#define KEY_F2 0x13
75#define KEY_F3 0x14
76#define KEY_F4 0x15
77#define KEY_W 0x0D
78#define KEY_A 0x00
79#define KEY_S 0x01
80#define KEY_D 0x02
81#define KEY_P 0x23
82#define KEY_SPACE 0x31
83#define KEY_KPADD 0x18
84#define KEY_KPSUB 0x1B
85#define KEY_B 0x0B
86#define KEY_F 0x03
87#define KEY_L 0x25
88#define KEY_N 0x2D
89#define KEY_O 0x1F
90#define KEY_T 0x11
91
92#elif defined(VK_USE_PLATFORM_DIRECTFB_EXT)
93#define KEY_ESCAPE DIKS_ESCAPE
94#define KEY_F1 DIKS_F1
95#define KEY_F2 DIKS_F2
96#define KEY_F3 DIKS_F3
97#define KEY_F4 DIKS_F4
98#define KEY_W DIKS_SMALL_W
99#define KEY_A DIKS_SMALL_A
100#define KEY_S DIKS_SMALL_S
101#define KEY_D DIKS_SMALL_D
102#define KEY_P DIKS_SMALL_P
103#define KEY_SPACE DIKS_SPACE
104#define KEY_KPADD DIKS_PLUS_SIGN
105#define KEY_KPSUB DIKS_MINUS_SIGN
106#define KEY_B DIKS_SMALL_B
107#define KEY_F DIKS_SMALL_F
108#define KEY_L DIKS_SMALL_L
109#define KEY_N DIKS_SMALL_N
110#define KEY_O DIKS_SMALL_O
111#define KEY_T DIKS_SMALL_T
112
113#elif defined(VK_USE_PLATFORM_WAYLAND_KHR)
114#include <linux/input.h>
115
116// todo: hack for bloom example
117#define KEY_KPADD KEY_KPPLUS
118#define KEY_KPSUB KEY_KPMINUS
119
120#elif defined(__linux__) || defined(__FreeBSD__)
121#define KEY_ESCAPE 0x9
122#define KEY_F1 0x43
123#define KEY_F2 0x44
124#define KEY_F3 0x45
125#define KEY_F4 0x46
126#define KEY_W 0x19
127#define KEY_A 0x26
128#define KEY_S 0x27
129#define KEY_D 0x28
130#define KEY_P 0x21
131#define KEY_SPACE 0x41
132#define KEY_KPADD 0x56
133#define KEY_KPSUB 0x52
134#define KEY_B 0x38
135#define KEY_F 0x29
136#define KEY_L 0x2E
137#define KEY_N 0x39
138#define KEY_O 0x20
139#define KEY_T 0x1C
140#endif