#include <keyboard_event.h>
Keyboard action event class.
Definition at line 17 of file keyboard_event.h.
◆ keyboard_event()
scl::keyboard_event::keyboard_event |
( |
bool |
Pressed, |
|
|
bool |
PrevPressed, |
|
|
keycode |
KeyCode |
|
) |
| |
|
inline |
- Keyboard event default constructor.
- Parameters
-
Pressed | - is key pressed or released flag. |
RepeatCount | - is key pressed continiaously flag. |
KeyCode | - kode of acting key |
Definition at line 35 of file keyboard_event.h.
35 :
36 Pressed(Pressed), PrevPressed(PrevPressed), KeyCode(KeyCode),
37 Clicked(!PrevPressed && Pressed) {}
◆ GetClicked()
int scl::keyboard_event::GetClicked |
( |
| ) |
|
|
inline |
◆ GetKeyCode()
keycode scl::keyboard_event::GetKeyCode |
( |
| ) |
|
|
inline |
◆ GetPressed()
bool scl::keyboard_event::GetPressed |
( |
| ) |
|
|
inline |
Key pressed or released flag getter function.
Definition at line 40 of file keyboard_event.h.
◆ GetPrevPressed()
int scl::keyboard_event::GetPrevPressed |
( |
| ) |
|
|
inline |
Key pressed continiaously flag getter function.
Definition at line 42 of file keyboard_event.h.
42{ return PrevPressed; }
◆ ToString()
std::string scl::keyboard_event::ToString |
( |
| ) |
const |
|
inlineoverridevirtual |
- Convert event to string (for debug).
- Parameters
-
- Returns
- string representation of event.
Reimplemented from scl::event.
Definition at line 54 of file keyboard_event.h.
55 {
56 std::stringstream ss;
57 ss <<
GetName() <<
": Pressed? - " << Pressed <<
", Prev. Pressed? - " << PrevPressed
58 << ", Clicked? - " << Clicked << ", KeyCode - " << (int)KeyCode;
59 return ss.str();
60 }
virtual const char * GetName() const =0
The documentation for this class was generated from the following file: