CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::UIKeyEvent Struct Reference

#include <CeresEngine/UI/UIEvent.hpp>

Inheritance diagram for CeresEngine::UIKeyEvent:
CeresEngine::UIEvent

Public Attributes

String characters
 The characters associated with a key-up or key-down event.
 
String charactersIgnoringModifiers
 The characters generated by a key event as if no modifier key (except for Shift) applies.
 
bool isRepeat = false
 A Boolean value that indicates whether the key event is a repeat.
 
UInt16 keyCode = 0
 The virtual key code for the keyboard key associated with a key event.
 
- Public Attributes inherited from CeresEngine::UIEvent
UIEventType type
 The event's type.
 
double timestamp = 0.0
 The time when the event occurred in seconds since system startup.
 
UIWindowwindow = nullptr
 The window object associated with the event.
 
UIModifierKeys modifiers = {}
 An integer bit field indicating the event's modifier keys.
 

Member Data Documentation

◆ characters

String CeresEngine::UIKeyEvent::characters

The characters associated with a key-up or key-down event.

These characters are derived from a keyboard mapping that associates various key combinations with Unicode characters. This property is only valid for key-up and key-down events.

This property is set to an empty string for dead keys, such as ctrl-e. However, for a key combination such as Option-Shift-e this property is set to the standard accent ("ยด").

◆ charactersIgnoringModifiers

String CeresEngine::UIKeyEvent::charactersIgnoringModifiers

The characters generated by a key event as if no modifier key (except for Shift) applies.

This property is set to the non-modifier key character pressed for dead keys, such as Option-e. For example, Option-e (no shift key) returns an "e" for this method, whereas the characters property returns an empty string.

This property is useful for determining "basic" key values in a hardware-independent manner, enabling such features as keyboard equivalents defined in terms of modifier keys plus character keys. For example, to determine if the user typed Alt-S, you don't have to know whether Alt-S generates a German double ess, an integral sign, or a section symbol. You simply examine the string contained by this property along with the event's modifier flags, checking for "s" and NSAlternateKeyMask.

◆ isRepeat

bool CeresEngine::UIKeyEvent::isRepeat = false

A Boolean value that indicates whether the key event is a repeat.

Contains true if the key event is a repeat caused by the user holding the key down; otherwise, false.

◆ keyCode

UInt16 CeresEngine::UIKeyEvent::keyCode = 0

The virtual key code for the keyboard key associated with a key event.

The property's value is hardware-independent.


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