X-Plane Remote Access Plugin and Client Library
|
#include <HotkeyHandler.h>
Public Member Functions | |
Hotkeys (size_t numHotkeys, hu::varadiistvan::scpl::io::DataStream &stream) | |
~Hotkeys () | |
bool | isValid () const |
bool | handleKey (uint16_t code) |
void | writePressed (hu::varadiistvan::scpl::io::DataStream &stream) |
Private Attributes | |
size_t | numHotkeys |
uint16_t * | hotkeys |
uint8_t * | pressed |
A set of hotkeys for a client.
Definition at line 64 of file HotkeyHandler.h.
HotkeyHandler::Hotkeys::Hotkeys | ( | size_t | numHotkeys, |
hu::varadiistvan::scpl::io::DataStream & | stream | ||
) |
Construct the set of hotkeys by reading the data from the given data stream.
Definition at line 51 of file HotkeyHandler.cc.
HotkeyHandler::Hotkeys::~Hotkeys | ( | ) |
Destroy the set of hotkeys.
Definition at line 66 of file HotkeyHandler.cc.
bool HotkeyHandler::Hotkeys::handleKey | ( | uint16_t | code | ) |
Handle the hotkey with the given code. If it matches any of the codes registered, the corresponding value in the pressed array will be set atomically.
Definition at line 74 of file HotkeyHandler.cc.
|
inline |
Determine if this hotkey set is valid.
Definition at line 169 of file HotkeyHandler.h.
void HotkeyHandler::Hotkeys::writePressed | ( | hu::varadiistvan::scpl::io::DataStream & | stream | ) |
Write the pressed indicators into the given stream. It also clears the indicators.
Definition at line 87 of file HotkeyHandler.cc.
|
private |
The hotkey codes.
Definition at line 75 of file HotkeyHandler.h.
|
private |
The number of hotkeys.
Definition at line 70 of file HotkeyHandler.h.
|
private |
The array of indicators whether the hotkey at the given index in the array of codes has been pressed.
Definition at line 81 of file HotkeyHandler.h.