#include <hps.h>

Public Member Functions | |
void | Assign (KeyboardState const &in_that) |
bool | Equals (KeyboardState const &in_that) const |
HPS::KeyboardEvent | GetActiveEvent () const |
HPS::KeyArray | GetEventPath () const |
HPS::WindowKey | GetEventSource () const |
size_t | GetKeyboardCodeCount () const |
HPS::KeyboardCodeArray | GetKeyboardCodes () const |
bool | GetKeyState (HPS::KeyboardCode in_key_code) const |
ModifierKeys | GetModifierKeys () const |
KeyboardState () | |
KeyboardState (KeyboardState const &in_that) | |
KeyboardState (KeyboardState &&in_that) | |
HPS::Type | ObjectType () const |
bool | operator!= (KeyboardState const &in_that) const |
KeyboardState & | operator= (KeyboardState &&in_that) |
KeyboardState & | operator= (KeyboardState const &in_that) |
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()) |
void | SetActiveEvent (KeyboardEvent const &in_event) |
void | SetEventPath (KeyArray const &in_path) |
void | SetKeyboardCodes (KeyboardCodeArray const &in_keyboard_codes) |
void | SetModifierKeys (ModifierKeys in_modifiers) |
![]() | |
virtual bool | Empty () const |
intptr_t | GetClassID () const |
intptr_t | GetInstanceID () const |
bool | HasType (HPS::Type in_mask) const |
Object (Object const &that) | |
Object (Object &&in_that) | |
Object & | operator= (Object const &other_object) |
Object & | operator= (Object &&in_that) |
virtual void | Reset () |
virtual HPS::Type | Type () const |
Static Public Attributes | |
static const HPS::Type | staticType = HPS::Type::KeyboardState |
![]() | |
static const HPS::Type | staticType = HPS::Type::None |
Additional Inherited Members | |
![]() | |
template<typename T > | |
static intptr_t | ClassID () |
Detailed Description
The KeyboardState class represents the state of a keyboard for a particular event.
Constructor & Destructor Documentation
◆ KeyboardState() [1/3]
HPS::KeyboardState::KeyboardState | ( | ) |
The default constructor creates an empty KeyboardState object.
◆ KeyboardState() [2/3]
HPS::KeyboardState::KeyboardState | ( | KeyboardState const & | in_that | ) |
The copy constructor creates a new KeyboardState object that contains the same settings as the source KeyboardState.
- Parameters
-
in_that The source KeyboardState to copy.
◆ KeyboardState() [3/3]
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.
- Parameters
-
in_that An rvalue reference to a KeyboardState to take the impl from.
Member Function Documentation
◆ Assign()
void HPS::KeyboardState::Assign | ( | KeyboardState const & | in_that | ) |
Copies the source KeyboardState into this KeyboardState.
- Parameters
-
in_that The source KeyboardState to copy.
◆ Equals()
bool HPS::KeyboardState::Equals | ( | KeyboardState const & | in_that | ) | const |
Check if the source KeyboardState is equivalent to this KeyboardState.
- Parameters
-
in_that The source KeyboardState to compare to this KeyboardState.
- Returns
- true if the objects are equivalent, false otherwise.
◆ GetActiveEvent()
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.
- Returns
- The action for the active keyboard codes for this KeyboardState.
◆ GetEventPath()
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.
- Returns
- The relevant list of keys up to the window which had focus when the keys represented by this KeyboardState were pressed or released.
◆ GetEventSource()
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.
- Returns
- The window which had focus when the keys represented by this KeyboardState were pressed or released.
◆ GetKeyboardCodeCount()
size_t HPS::KeyboardState::GetKeyboardCodeCount | ( | ) | const |
Get the number of keys currently down in this KeyboardState.
- Returns
- Number of active and inactive keyboard codes.
◆ GetKeyboardCodes()
HPS::KeyboardCodeArray HPS::KeyboardState::GetKeyboardCodes | ( | ) | const |
Get the list of keyboard codes for keys currently down in this KeyboardState.
- Returns
- The list of active and inactive keyboard codes.
◆ GetKeyState()
bool HPS::KeyboardState::GetKeyState | ( | HPS::KeyboardCode | in_key_code | ) | const |
Get the state of a specific keyboard code for this KeyboardState.
- Parameters
-
in_key_code The keyboard code for which to query the action.
- Returns
- true if the key is down, false otherwise.
◆ GetModifierKeys()
ModifierKeys HPS::KeyboardState::GetModifierKeys | ( | ) | const |
Get an object representing the state of modifier keys for this KeyboardState.
- Returns
- An object representing the state of modifier keys.
◆ ObjectType()
|
inlinevirtual |
This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).
- Returns
- The declared type of the object in question, which may differ from the true, underlying type.
Reimplemented from HPS::Object.
◆ operator!=()
bool HPS::KeyboardState::operator!= | ( | KeyboardState const & | in_that | ) | const |
Check if the source KeyboardState is not equivalent to this KeyboardState.
- Parameters
-
in_that The source KeyboardState to compare to this KeyboardState.
- Returns
- true if the objects are not equivalent, false otherwise.
◆ operator=() [1/2]
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.
- Parameters
-
in_that An rvalue reference to a KeyboardState to take the impl from.
- Returns
- A reference to this KeyboardState.
◆ operator=() [2/2]
KeyboardState& HPS::KeyboardState::operator= | ( | KeyboardState const & | in_that | ) |
Copies the source KeyboardState into this KeyboardState.
- Parameters
-
in_that The source KeyboardState to copy.
- Returns
- A reference to this KeyboardState.
◆ operator==()
bool HPS::KeyboardState::operator== | ( | KeyboardState const & | in_that | ) | const |
Check if the source KeyboardState is equivalent to this KeyboardState.
- Parameters
-
in_that The source KeyboardState to compare to this KeyboardState.
- Returns
- true if the objects are equivalent, false otherwise.
◆ Set()
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.
- Parameters
-
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.
◆ SetActiveEvent()
void HPS::KeyboardState::SetActiveEvent | ( | KeyboardEvent const & | in_event | ) |
Sets the active event for this KeyboardState.
- Parameters
-
in_event The action for this KeyboardState.
◆ SetEventPath()
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.
- Parameters
-
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.
◆ SetKeyboardCodes()
void HPS::KeyboardState::SetKeyboardCodes | ( | KeyboardCodeArray const & | in_keyboard_codes | ) |
Sets the list of keyboard codes for keys currently down in this KeyboardState.
- Parameters
-
in_keyboard_codes The list of keyboard codes for keys currently down during this keyboard event.
◆ SetModifierKeys()
void HPS::KeyboardState::SetModifierKeys | ( | ModifierKeys | in_modifiers | ) |
Sets an object representing the state of modifier keys for this KeyboardState.
- Parameters
-
in_modifiers An object representing the state of modifier keys.
The documentation for this class was generated from the following file:
- include/hps.h