Topaz 5.0
Topaz Game Engine
|
Retrieve keyboard/mouse input.
tz::error_code tz::os::install_char_typed_callback | ( | char_type_callback | callback | ) |
Install a callback which will be invoked whenever the user types a character on the keyboard.
callback | Pointer to a function which will be called whenever a character is typed. If you pass nullptr, the callback will safely be ignored. |
bool tz::os::is_key_pressed | ( | key | k | ) |
Query as to whether a specific key is pressed right now.
k | Keyboard key to query |
std::pair< unsigned int, unsigned int > tz::os::get_mouse_position | ( | ) |
Retrieve the mouse cursor's current position, in pixels, relative to the top-left of the window.
If for whatever reason the cursor pos cannot be retrieved, {-1, -1} is returned. Some reasons could include:
|
strong |
Represents a key on your keyboard.