X-Plane Remote Access Plugin and Client Library
Public Member Functions | Private Attributes | List of all members
xplra::HotkeyHandler::Hotkeys Class Reference

#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
 

Detailed Description

A set of hotkeys for a client.

Definition at line 64 of file HotkeyHandler.h.

Constructor & Destructor Documentation

◆ Hotkeys()

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.

◆ ~Hotkeys()

HotkeyHandler::Hotkeys::~Hotkeys ( )

Destroy the set of hotkeys.

Definition at line 66 of file HotkeyHandler.cc.

Member Function Documentation

◆ handleKey()

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.

Returns
whether the hotkey was handled or not.

Definition at line 74 of file HotkeyHandler.cc.

◆ isValid()

bool xplra::HotkeyHandler::Hotkeys::isValid ( ) const
inline

Determine if this hotkey set is valid.

Definition at line 169 of file HotkeyHandler.h.

◆ writePressed()

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.

Member Data Documentation

◆ hotkeys

uint16_t* xplra::HotkeyHandler::Hotkeys::hotkeys
private

The hotkey codes.

Definition at line 75 of file HotkeyHandler.h.

◆ numHotkeys

size_t xplra::HotkeyHandler::Hotkeys::numHotkeys
private

The number of hotkeys.

Definition at line 70 of file HotkeyHandler.h.

◆ pressed

uint8_t* xplra::HotkeyHandler::Hotkeys::pressed
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.


The documentation for this class was generated from the following files: