clan::KeyEvent Class Reference - ClanLib SDK
Description: clan::KeyEvent Class Reference

Public Member Functions | List of all members
clan::KeyEvent Class Reference

Keyboard key event. More...

`#include <key_event.h>`

Inheritance diagram for clan::KeyEvent:

## Public Member Functions
| KeyEvent (KeyEventType type, Key key, int repeat_count, const std::string &text, const Pointf &pointer_pos, bool alt_down, bool shift_down, bool ctrl_down, bool cmd_down)
bool | alt_down () const
| True if the alt key was down.
bool | cmd_down () const
| True if the command key was down.
bool | ctrl_down () const
| True if the control key was down.
Key | key () const
| Key relevant for the event.
Pointf | pointer_pos (View *view) const
| Cursor position returned in local content coordinates for the view specified.
int | repeat_count () const
| Key press repeat counter for key being held down.
bool | shift_down () const
| True if the shift key was down.
const std::string & | text () const
| Unicode characters generated by this event.
KeyEventType | type () const
| Key event type.
Public Member Functions inherited from clan::EventUI
virtual | ~EventUI ()
std::shared_ptr< View > | current_target ()
| View the event is currently being dispatched to.
bool | default_prevented () const
| Flag if the event default action should be executed after dispatch.
EventUIPhase | phase () const
| Current active event phase during dispatch.
void | prevent_default ()
| Prevent default action from being executed after dispatch.
bool | propagation_stopped () const
| Flag if event propagation should stop.
void | set_timestamp (long long ts)
| Set event timestamp.
void | stop_propagation ()
| Stops event from propagating further.
std::shared_ptr< View > | target ()
| The target view the event is fired for.
long long | timestamp () const
| Timestamp for event in milliseconds since 1970.

## Detailed Description

Keyboard key event.

## Constructor & Destructor Documentation

## ◆ KeyEvent()

clan::KeyEvent::KeyEvent | ( | KeyEventType | type,
|  | Key | key,
|  | int | repeat_count,
|  | const std::string & | text,
|  | const Pointf & | pointer_pos,
|  | bool | alt_down,
|  | bool | shift_down,
|  | bool | ctrl_down,
|  | bool | cmd_down )
| inline

References alt_down(), cmd_down(), ctrl_down(), key(), pointer_pos(), repeat_count(), shift_down(), text(), and type().

## Member Function Documentation

## ◆ alt_down()

bool clan::KeyEvent::alt_down | ( |  | ) | const
| inline

True if the alt key was down.

Referenced by KeyEvent().

## ◆ cmd_down()

bool clan::KeyEvent::cmd_down | ( |  | ) | const
| inline

True if the command key was down.

Referenced by KeyEvent().

## ◆ ctrl_down()

bool clan::KeyEvent::ctrl_down | ( |  | ) | const
| inline

True if the control key was down.

Referenced by KeyEvent().

## ◆ key()

Key clan::KeyEvent::key | ( |  | ) | const
| inline

Key relevant for the event.

Referenced by KeyEvent().

## ◆ pointer_pos()

Pointf clan::KeyEvent::pointer_pos | ( | View * | view | ) | const

Cursor position returned in local content coordinates for the view specified.

References clan::EventUI::View.

Referenced by KeyEvent().

## ◆ repeat_count()

int clan::KeyEvent::repeat_count | ( |  | ) | const
| inline

Key press repeat counter for key being held down.

Referenced by KeyEvent().

## ◆ shift_down()

bool clan::KeyEvent::shift_down | ( |  | ) | const
| inline

True if the shift key was down.

Referenced by KeyEvent().

## ◆ text()

const std::string & clan::KeyEvent::text | ( |  | ) | const
| inline

Unicode characters generated by this event.

Referenced by KeyEvent().

## ◆ type()

KeyEventType clan::KeyEvent::type | ( |  | ) | const
| inline

Key event type.

Referenced by KeyEvent().

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

- key_event.h