1 /*  RetroArch - A frontend for libretro.
2  *  Copyright (C) 2011-2017 - Daniel De Matteis
3  *  Copyright (C) 2016-2019 - Brad Parker
4  *
5  *  RetroArch is free software: you can redistribute it and/or modify it under the terms
6  *  of the GNU General Public License as published by the Free Software Found-
7  *  ation, either version 3 of the License, or (at your option) any later version.
8  *
9  *  RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  *  PURPOSE.  See the GNU General Public License for more details.
12  *
13  *  You should have received a copy of the GNU General Public License along with RetroArch.
14  *  If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef _KEYBOARD_EVENT_DOS_H
18 #define _KEYBOARD_EVENT_DOS_H
19 
20 #include "../input_driver.h"
21 
22 /*
23  * Key codes.
24  */
25 enum {
26    DOSKEY_ESCAPE = 0x1,
27    DOSKEY_F1 = 0x3b,
28    DOSKEY_F2 = 0x3c,
29    DOSKEY_F3 = 0x3d,
30    DOSKEY_F4 = 0x3e,
31    DOSKEY_F5 = 0x3f,
32    DOSKEY_F6 = 0x40,
33    DOSKEY_F7 = 0x41,
34    DOSKEY_F8 = 0x42,
35    DOSKEY_F9 = 0x43,
36    DOSKEY_F10 = 0x44,
37 
38    DOSKEY_BACKQUOTE = 0x29,
39    DOSKEY_1 = 0x2,
40    DOSKEY_2 = 0x3,
41    DOSKEY_3 = 0x4,
42    DOSKEY_4 = 0x5,
43    DOSKEY_5 = 0x6,
44    DOSKEY_6 = 0x7,
45    DOSKEY_7 = 0x8,
46    DOSKEY_8 = 0x9,
47    DOSKEY_9 = 0xa,
48    DOSKEY_0 = 0xb,
49    DOSKEY_MINUS = 0xc,
50    DOSKEY_EQUAL = 0xd,
51    DOSKEY_BACKSPACE = 0xe,
52 
53    DOSKEY_TAB = 0xf,
54    DOSKEY_q = 0x10,
55    DOSKEY_w = 0x11,
56    DOSKEY_e = 0x12,
57    DOSKEY_r = 0x13,
58    DOSKEY_t = 0x14,
59    DOSKEY_y = 0x15,
60    DOSKEY_u = 0x16,
61    DOSKEY_i = 0x17,
62    DOSKEY_o = 0x18,
63    DOSKEY_p = 0x19,
64    DOSKEY_LBRACKET = 0x1a,
65    DOSKEY_RBRACKET = 0x1b,
66    DOSKEY_BACKSLASH = 0x2b,
67 
68    DOSKEY_CAPSLOCK = 0x3a,
69    DOSKEY_a = 0x1e,
70    DOSKEY_s = 0x1f,
71    DOSKEY_d = 0x20,
72    DOSKEY_f = 0x21,
73    DOSKEY_g = 0x22,
74    DOSKEY_h = 0x23,
75    DOSKEY_j = 0x24,
76    DOSKEY_k = 0x25,
77    DOSKEY_l = 0x26,
78    DOSKEY_SEMICOLON = 0x27,
79    DOSKEY_QUOTE = 0x28,
80    DOSKEY_RETURN = 0x1c,
81 
82    DOSKEY_LSHIFT = 0x2a,
83    DOSKEY_z = 0x2c,
84    DOSKEY_x = 0x2d,
85    DOSKEY_c = 0x2e,
86    DOSKEY_v = 0x2f,
87    DOSKEY_b = 0x30,
88    DOSKEY_n = 0x31,
89    DOSKEY_m = 0x32,
90    DOSKEY_COMMA = 0x33,
91    DOSKEY_PERIOD = 0x34,
92    DOSKEY_SLASH = 0x35,
93    DOSKEY_RSHIFT = 0x36,
94 
95    DOSKEY_LCTRL = 0x1d,
96    DOSKEY_LSUPER = 0x15b,
97    DOSKEY_LALT = 0x38,
98    DOSKEY_SPACE = 0x39,
99    DOSKEY_RALT = 0x138,
100    DOSKEY_RSUPER = 0x15c,
101    DOSKEY_MENU = 0x15d,
102    DOSKEY_RCTRL = 0x11d,
103 
104    DOSKEY_UP = 0x148,
105    DOSKEY_DOWN = 0x150,
106    DOSKEY_LEFT = 0x14b,
107    DOSKEY_RIGHT = 0x14d,
108 
109    DOSKEY_HOME = 0x147,
110    DOSKEY_END = 0x14f,
111    DOSKEY_PGUP = 0x149,
112    DOSKEY_PGDN = 0x151,
113 };
114 
115 #include <stdint.h>
116 
117 #include <boolean.h>
118 
119 #include "../../config.def.h"
120 
121 #define LAST_KEYCODE 0x1ff
122 
123 uint16_t *dos_keyboard_state_get(unsigned port);
124 
125 #endif
126