#include <key_handler_controller.h>
Classes | |
struct | GetChoice |
struct | ReadBuffer |
Public Types | |
typedef bool(* | Callback) (int, void *) |
typedef struct Ultima::Ultima4::KeyHandler::ReadBuffer | ReadBuffer |
typedef struct Ultima::Ultima4::KeyHandler::GetChoice | GetChoice |
Public Member Functions | |
KeyHandler (Callback func, void *data=nullptr, bool asyncronous=true) | |
bool | operator== (Callback cb) const |
bool | handle (int key) |
virtual bool | isKeyIgnored (int key) |
Static Public Member Functions | |
static bool | globalHandler (int key) |
static bool | defaultHandler (int key, void *data) |
static bool | ignoreKeys (int key, void *data) |
Protected Attributes | |
Callback | _handler |
bool | _async |
void * | _data |
A class for handling keystrokes.
Additional information to be passed as data param for read buffer key handler
Additional information to be passed as data param for get choice key handler
|
static |
Handles any and all keystrokes. Generally used to exit the application, switch applications, minimize, maximize, etc.
|
static |
A default key handler that should be valid everywhere
|
static |
A key handler that ignores keypresses
bool Ultima::Ultima4::KeyHandler::handle | ( | int | key | ) |
Handles a keypress. First it makes sure the key combination is not ignored by the current key handler. Then, it passes the keypress through the global key handler. If the global handler does not process the keystroke, then the key handler handles it itself by calling its handler callback function.
|
virtual |
Returns true if the key or key combination is always ignored by xu4