ScummVM API documentation
atari-events.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKEND_EVENTS_ATARI_H
23 #define BACKEND_EVENTS_ATARI_H
24 
25 #include "common/events.h"
26 
27 #include "common/hashmap.h"
28 
30 class OSystem_Atari;
31 
36 public:
38 
39  bool pollEvent(Common::Event &event) override;
40 
41  void setGraphicsManager(AtariGraphicsManager *graphicsManager) { _graphicsManager = graphicsManager; }
42 
43 private:
44  OSystem_Atari *_system = nullptr;
45  AtariGraphicsManager *_graphicsManager = nullptr;
46 
47  bool _lmbDown = false;
48  bool _mmbDown = false;
49  bool _rmbDown = false;
50 
51  bool _lshiftActive = false;
52  bool _rshiftActive = false;
53  bool _ctrlActive = false;
54  bool _altActive = false;
55  bool _capslockActive = false;
56  bool _scrolllockActive = false;
57  bool _numlockActive = false;
58 
59  byte _unshiftToAscii[128];
60  byte _shiftToAscii[128];
61  byte _capsToAscii[128];
62 
63  const Common::KeyCode _asciiToKeycode[128 - 32 - 1] = {
64  Common::KEYCODE_SPACE,
65  Common::KEYCODE_EXCLAIM,
66  Common::KEYCODE_QUOTEDBL,
67  Common::KEYCODE_HASH,
68  Common::KEYCODE_DOLLAR,
69  Common::KEYCODE_PERCENT,
70  Common::KEYCODE_AMPERSAND,
71  Common::KEYCODE_QUOTE,
72  Common::KEYCODE_LEFTPAREN,
73  Common::KEYCODE_RIGHTPAREN,
74  Common::KEYCODE_ASTERISK,
75  Common::KEYCODE_PLUS,
76  Common::KEYCODE_COMMA,
77  Common::KEYCODE_MINUS,
78  Common::KEYCODE_PERIOD,
79  Common::KEYCODE_SLASH,
80  Common::KEYCODE_0,
81  Common::KEYCODE_1,
82  Common::KEYCODE_2,
83  Common::KEYCODE_3,
84  Common::KEYCODE_4,
85  Common::KEYCODE_5,
86  Common::KEYCODE_6,
87  Common::KEYCODE_7,
88  Common::KEYCODE_8,
89  Common::KEYCODE_9,
90  Common::KEYCODE_COLON,
91  Common::KEYCODE_SEMICOLON,
92  Common::KEYCODE_LESS,
93  Common::KEYCODE_EQUALS,
94  Common::KEYCODE_GREATER,
95  Common::KEYCODE_QUESTION,
96  Common::KEYCODE_AT,
97  Common::KEYCODE_a,
98  Common::KEYCODE_b,
99  Common::KEYCODE_c,
100  Common::KEYCODE_d,
101  Common::KEYCODE_e,
102  Common::KEYCODE_f,
103  Common::KEYCODE_g,
104  Common::KEYCODE_h,
105  Common::KEYCODE_i,
106  Common::KEYCODE_j,
107  Common::KEYCODE_k,
108  Common::KEYCODE_l,
109  Common::KEYCODE_m,
110  Common::KEYCODE_n,
111  Common::KEYCODE_o,
112  Common::KEYCODE_p,
113  Common::KEYCODE_q,
114  Common::KEYCODE_r,
115  Common::KEYCODE_s,
116  Common::KEYCODE_t,
117  Common::KEYCODE_u,
118  Common::KEYCODE_v,
119  Common::KEYCODE_w,
120  Common::KEYCODE_x,
121  Common::KEYCODE_y,
122  Common::KEYCODE_z,
123  Common::KEYCODE_LEFTBRACKET,
124  Common::KEYCODE_BACKSLASH,
125  Common::KEYCODE_RIGHTBRACKET,
126  Common::KEYCODE_CARET,
127  Common::KEYCODE_UNDERSCORE,
128  Common::KEYCODE_BACKQUOTE,
129  Common::KEYCODE_a,
130  Common::KEYCODE_b,
131  Common::KEYCODE_c,
132  Common::KEYCODE_d,
133  Common::KEYCODE_e,
134  Common::KEYCODE_f,
135  Common::KEYCODE_g,
136  Common::KEYCODE_h,
137  Common::KEYCODE_i,
138  Common::KEYCODE_j,
139  Common::KEYCODE_k,
140  Common::KEYCODE_l,
141  Common::KEYCODE_m,
142  Common::KEYCODE_n,
143  Common::KEYCODE_o,
144  Common::KEYCODE_p,
145  Common::KEYCODE_q,
146  Common::KEYCODE_r,
147  Common::KEYCODE_s,
148  Common::KEYCODE_t,
149  Common::KEYCODE_u,
150  Common::KEYCODE_v,
151  Common::KEYCODE_w,
152  Common::KEYCODE_x,
153  Common::KEYCODE_y,
154  Common::KEYCODE_z,
155  Common::KEYCODE_INVALID, // {
156  Common::KEYCODE_INVALID, // |
157  Common::KEYCODE_INVALID, // }
158  Common::KEYCODE_TILDE
159  };
160  Common::HashMap<byte, Common::KeyCode> _scancodeToKeycode;
161 };
162 
163 #endif
bool pollEvent(Common::Event &event) override
Definition: osystem_atari.h:27
Definition: atari-events.h:35
Definition: events.h:199
Definition: events.h:259
Definition: atari-graphics.h:39