Annwvyn::AnnKeyEvent Class Reference

A keyboard event. More...

#include <AnnEvents.hpp>

Inheritance diagram for Annwvyn::AnnKeyEvent:
Collaboration diagram for Annwvyn::AnnKeyEvent:

Public Member Functions

KeyCode::code getKey () const
 Get the key involved in that event. More...
 
bool isPressed () const
 Return true if it's a key press. Key event are debounced. More...
 
bool isReleased () const
 Return true if it's a key release. Key event are debounced. More...
 
bool shouldIgnore () const
 If this is true, it probably means that the keyboard is used for something else and that you should ignore this event. More...
 
- Public Member Functions inherited from Annwvyn::AnnEvent
 AnnEvent ()
 Event constructor. More...
 
AnnEventType getType () const
 

Private Member Functions

 AnnKeyEvent ()
 Keyboard event constructor. More...
 
void setPressed ()
 Set the event as a key release event. More...
 
void setReleased ()
 Set the event as a key press event. More...
 
void setCode (KeyCode::code c)
 

Private Attributes

KeyCode::code key
 Code of the key this event relate to. More...
 
bool pressed
 Pressed state. More...
 
bool ignored
 Keyboard event that should be ignored has this flag as "true". More...
 

Friends

class AnnEventManager
 

Additional Inherited Members

- Protected Attributes inherited from Annwvyn::AnnEvent
AnnEventType type
 

Detailed Description

A keyboard event.

Definition at line 37 of file AnnEvents.hpp.

Constructor & Destructor Documentation

◆ AnnKeyEvent()

AnnKeyEvent::AnnKeyEvent ( )
private

Keyboard event constructor.

Definition at line 22 of file AnnEvents.cpp.

Member Function Documentation

◆ getKey()

KeyCode::code AnnKeyEvent::getKey ( ) const

Get the key involved in that event.

Definition at line 56 of file AnnEvents.cpp.

◆ isPressed()

bool AnnKeyEvent::isPressed ( ) const

Return true if it's a key press. Key event are debounced.

Definition at line 46 of file AnnEvents.cpp.

◆ isReleased()

bool AnnKeyEvent::isReleased ( ) const

Return true if it's a key release. Key event are debounced.

Definition at line 51 of file AnnEvents.cpp.

◆ setCode()

void AnnKeyEvent::setCode ( KeyCode::code  c)
private

Set the keycode of the key

Parameters
cKeycode

Definition at line 41 of file AnnEvents.cpp.

◆ setPressed()

void AnnKeyEvent::setPressed ( )
private

Set the event as a key release event.

Definition at line 31 of file AnnEvents.cpp.

◆ setReleased()

void AnnKeyEvent::setReleased ( )
private

Set the event as a key press event.

Definition at line 36 of file AnnEvents.cpp.

◆ shouldIgnore()

bool AnnKeyEvent::shouldIgnore ( ) const

If this is true, it probably means that the keyboard is used for something else and that you should ignore this event.

Definition at line 61 of file AnnEvents.cpp.

Friends And Related Function Documentation

◆ AnnEventManager

friend class AnnEventManager
friend

Definition at line 53 of file AnnEvents.hpp.

Member Data Documentation

◆ ignored

bool Annwvyn::AnnKeyEvent::ignored
private

Keyboard event that should be ignored has this flag as "true".

Definition at line 59 of file AnnEvents.hpp.

◆ key

KeyCode::code Annwvyn::AnnKeyEvent::key
private

Code of the key this event relate to.

Definition at line 55 of file AnnEvents.hpp.

◆ pressed

bool Annwvyn::AnnKeyEvent::pressed
private

Pressed state.

Definition at line 57 of file AnnEvents.hpp.


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