#include <hps.h>
Public Member Functions | |
KeyboardState () | |
KeyboardState (KeyboardState const &in_that) | |
KeyboardState (KeyboardState &&in_that) | |
KeyboardState & | operator= (KeyboardState &&in_that) |
HPS::Type | ObjectType () const |
void | Assign (KeyboardState const &in_that) |
KeyboardState & | operator= (KeyboardState const &in_that) |
bool | Equals (KeyboardState const &in_that) const |
bool | operator== (KeyboardState const &in_that) const |
bool | operator!= (KeyboardState const &in_that) const |
void | Set (KeyArray const &in_path, KeyboardEvent const &in_event, KeyboardCodeArray const &in_keyboard_codes, ModifierKeys in_modifiers=ModifierKeys()) |
HPS::KeyboardEvent | GetActiveEvent () const |
HPS::WindowKey | GetEventSource () const |
HPS::KeyArray | GetEventPath () const |
size_t | GetKeyboardCodeCount () const |
HPS::KeyboardCodeArray | GetKeyboardCodes () const |
bool | GetKeyState (HPS::KeyboardCode in_key_code) const |
ModifierKeys | GetModifierKeys () const |
void | SetActiveEvent (KeyboardEvent const &in_event) |
void | SetEventPath (KeyArray const &in_path) |
void | SetKeyboardCodes (KeyboardCodeArray const &in_keyboard_codes) |
void | SetModifierKeys (ModifierKeys in_modifiers) |
![]() | |
Object & | operator= (Object const &other_object) |
Object (Object &&in_that) | |
Object & | operator= (Object &&in_that) |
HPS::Type | Type () const |
virtual bool | Empty () const |
virtual void | Reset () |
bool | HasType (HPS::Type in_mask) const |
intptr_t | GetClassID () const |
intptr_t | GetInstanceID () const |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static intptr_t | ClassID () |
The KeyboardState class represents the state of a keyboard for a particular event.
HPS::KeyboardState::KeyboardState | ( | ) |
The default constructor creates an empty KeyboardState object.
HPS::KeyboardState::KeyboardState | ( | KeyboardState const & | in_that | ) |
The copy constructor creates a new KeyboardState object that contains the same settings as the source KeyboardState.
in_that | The source KeyboardState to copy. |
HPS::KeyboardState::KeyboardState | ( | KeyboardState && | in_that | ) |
The move constructor creates a KeyboardState by transferring the underlying impl of the rvalue reference to this KeyboardState thereby avoiding a copy and allocation.
in_that | An rvalue reference to a KeyboardState to take the impl from. |
void HPS::KeyboardState::Assign | ( | KeyboardState const & | in_that | ) |
Copies the source KeyboardState into this KeyboardState.
in_that | The source KeyboardState to copy. |
bool HPS::KeyboardState::Equals | ( | KeyboardState const & | in_that | ) | const |
Check if the source KeyboardState is equivalent to this KeyboardState.
in_kit | The source KeyboardState to compare to this KeyboardState. |
HPS::KeyboardEvent HPS::KeyboardState::GetActiveEvent | ( | ) | const |
Get the active event for this KeyboardState. This will throw an exception if there is no active action for this KeyboardState.
HPS::KeyArray HPS::KeyboardState::GetEventPath | ( | ) | const |
Get the relevant list of keys up to the window which had focus when the keys represented by this KeyboardState were pressed or released. This will throw an exception if there is no event path for this KeyboardState.
HPS::WindowKey HPS::KeyboardState::GetEventSource | ( | ) | const |
Get the window which had focus when the keys represented by this KeyboardState were pressed or released. This will throw an exception if there is no event source for this KeyboardState.
size_t HPS::KeyboardState::GetKeyboardCodeCount | ( | ) | const |
Get the number of keys currently down in this KeyboardState.
HPS::KeyboardCodeArray HPS::KeyboardState::GetKeyboardCodes | ( | ) | const |
Get the list of keyboard codes for keys currently down in this KeyboardState.
bool HPS::KeyboardState::GetKeyState | ( | HPS::KeyboardCode | in_key_code | ) | const |
Get the state of a specific keyboard code for this KeyboardState.
in_key_code | The keyboard code for which to query the action. |
ModifierKeys HPS::KeyboardState::GetModifierKeys | ( | ) | const |
Get an object representing the state of modifier keys for this KeyboardState.
|
inlinevirtual |
This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.
Reimplemented from HPS::Object.
bool HPS::KeyboardState::operator!= | ( | KeyboardState const & | in_that | ) | const |
Check if the source KeyboardState is not equivalent to this KeyboardState.
in_kit | The source KeyboardState to compare to this KeyboardState. |
KeyboardState& HPS::KeyboardState::operator= | ( | KeyboardState && | in_that | ) |
The move assignment operator transfers the underlying impl of the rvalue reference to this KeyboardState thereby avoiding a copy.
in_that | An rvalue reference to a KeyboardState to take the impl from. |
KeyboardState& HPS::KeyboardState::operator= | ( | KeyboardState const & | in_that | ) |
Copies the source KeyboardState into this KeyboardState.
in_that | The source KeyboardState to copy. |
bool HPS::KeyboardState::operator== | ( | KeyboardState const & | in_that | ) | const |
Check if the source KeyboardState is equivalent to this KeyboardState.
in_kit | The source KeyboardState to compare to this KeyboardState. |
void HPS::KeyboardState::Set | ( | KeyArray const & | in_path, |
KeyboardEvent const & | in_event, | ||
KeyboardCodeArray const & | in_keyboard_codes, | ||
ModifierKeys | in_modifiers = ModifierKeys() |
||
) |
Sets the properties of this KeyboardState.
in_path | The list of keys up to the window which had focus for this keyboard event. |
in_event | The keyboard event. |
in_keyboard_codes | The list of keyboard codes for keys currently down during this keyboard event. |
in_modifiers | The state of modifier keys for this keyboard event. |
void HPS::KeyboardState::SetActiveEvent | ( | KeyboardEvent const & | in_event | ) |
Sets the active event for this KeyboardState.
in_event | The action for this KeyboardState. |
void HPS::KeyboardState::SetEventPath | ( | KeyArray const & | in_path | ) |
Sets the relevant list of keys up to the window which had focus for this keyboard event.
in_path | The relevant list of keys up to the window which had focus when the keyboard event represented by this KeyboardState underwent the active action. |
void HPS::KeyboardState::SetKeyboardCodes | ( | KeyboardCodeArray const & | in_keyboard_codes | ) |
Sets the list of keyboard codes for keys currently down in this KeyboardState.
in_keyboard_codes | The list of keyboard codes for keys currently down during this keyboard event. |
void HPS::KeyboardState::SetModifierKeys | ( | ModifierKeys | in_modifiers | ) |
Sets an object representing the state of modifier keys for this KeyboardState.
in_modifiers | An object representing the state of modifier keys. |