Definition at line 59 of file input.hpp.
◆ text_input()
bool wze::input::text_input |
( |
| ) |
|
|
staticnodiscard |
Definition at line 183 of file input.cpp.
183 {
184 return (bool)SDL_IsTextInputActive();
185}
◆ set_text_input()
void wze::input::set_text_input |
( |
bool | text_input | ) |
|
|
static |
Definition at line 187 of file input.cpp.
187 {
188 if (text_input) {
189 SDL_StartTextInput();
190 } else {
191 SDL_StopTextInput();
192 }
193}
◆ key() [1/3]
uint32_t wze::input::key |
( |
| ) |
|
|
staticnodiscard |
Definition at line 195 of file input.cpp.
195 {
196 return _key;
197}
◆ keymaps()
std::unordered_map< std::string, std::vector< wze::key > > & wze::input::keymaps |
( |
| ) |
|
|
staticnodiscard |
Definition at line 199 of file input.cpp.
199 {
200 return _keymaps;
201}
◆ cursor_absolute_x()
float wze::input::cursor_absolute_x |
( |
| ) |
|
|
staticnodiscard |
Definition at line 203 of file input.cpp.
203 {
204 return _cursor_absolute_x;
205}
◆ cursor_absolute_y()
float wze::input::cursor_absolute_y |
( |
| ) |
|
|
staticnodiscard |
Definition at line 207 of file input.cpp.
207 {
208 return _cursor_absolute_y;
209}
◆ cursor_relative_x()
float wze::input::cursor_relative_x |
( |
| ) |
|
|
staticnodiscard |
Definition at line 211 of file input.cpp.
211 {
212 return _cursor_relative_x;
213}
◆ cursor_relative_y()
float wze::input::cursor_relative_y |
( |
| ) |
|
|
staticnodiscard |
Definition at line 215 of file input.cpp.
215 {
216 return _cursor_relative_y;
217}
◆ mouse_sensitivity()
float wze::input::mouse_sensitivity |
( |
| ) |
|
|
staticnodiscard |
Definition at line 219 of file input.cpp.
219 {
220 return _mouse_sensitivity;
221}
◆ set_mouse_sensitivity()
void wze::input::set_mouse_sensitivity |
( |
float | mouse_sensitivity | ) |
|
|
static |
Definition at line 223 of file input.cpp.
223 {
224 _mouse_sensitivity = mouse_sensitivity;
225}
◆ cursor_visible()
bool wze::input::cursor_visible |
( |
| ) |
|
|
staticnodiscard |
Definition at line 227 of file input.cpp.
227 {
228 return (bool)SDL_GetRelativeMouseMode();
229}
◆ set_cursor_visible()
void wze::input::set_cursor_visible |
( |
bool | cursor_visible | ) |
|
|
static |
Definition at line 231 of file input.cpp.
231 {
232 if ((bool)SDL_SetRelativeMouseMode((SDL_bool)!cursor_visible)) {
233 throw exception(SDL_GetError());
234 }
235}
◆ set_cursor_appearance()
void wze::input::set_cursor_appearance |
( |
std::unique_ptr< cursor, std::function< void(cursor *)> > | cursor_appearance | ) |
|
|
static |
Definition at line 237 of file input.cpp.
238 {
239 SDL_SetCursor(cursor_appearance.release());
240}
◆ fingers()
std::unordered_map< size_t, wze::finger > const & wze::input::fingers |
( |
| ) |
|
|
staticnodiscard |
Definition at line 242 of file input.cpp.
242 {
243 return _fingers;
244}
◆ gesture()
std::optional< wze::gesture > const & wze::input::gesture |
( |
| ) |
|
|
staticnodiscard |
Definition at line 246 of file input.cpp.
246 {
247 return _gesture;
248}
◆ accelerometer_x()
float wze::input::accelerometer_x |
( |
| ) |
|
|
staticnodiscard |
Definition at line 250 of file input.cpp.
250 {
251 return _accelerometer_xyz.at(1);
252}
◆ accelerometer_y()
float wze::input::accelerometer_y |
( |
| ) |
|
|
staticnodiscard |
Definition at line 254 of file input.cpp.
254 {
255 return _accelerometer_xyz.at(0);
256}
◆ accelerometer_z()
float wze::input::accelerometer_z |
( |
| ) |
|
|
staticnodiscard |
Definition at line 258 of file input.cpp.
258 {
259 return _accelerometer_xyz.at(2);
260}
◆ key() [2/3]
bool wze::input::key |
( |
enum key key | | ) |
|
|
staticnodiscard |
Definition at line 286 of file input.cpp.
286 {
287 return _keys.at(key);
288}
◆ key() [3/3]
bool wze::input::key |
( |
std::string const & | name | ) |
|
|
staticnodiscard |
Definition at line 290 of file input.cpp.
290 {
291 std::vector<enum key>& keys = keymaps().at(name);
292 return std::any_of(keys.begin(), keys.end(), [](enum key key) -> bool {
293 return input::key(key);
294 });
295}
◆ cursor_spatial()
std::pair< float, float > wze::input::cursor_spatial |
( |
float | z | ) |
|
|
staticnodiscard |
Definition at line 297 of file input.cpp.
297 {
298 return camera::unproject(cursor_absolute_x(), cursor_absolute_y(), z);
299}
The documentation for this class was generated from the following files: