LMMS
Loading...
Searching...
No Matches
PuglKeyEvent Struct Reference

#include <pugl.h>

Public Attributes

PuglEventType type
 PUGL_KEY_PRESS or PUGL_KEY_RELEASE
PuglEventFlags flags
 Bitwise OR of PuglEventFlag values.
double time
 Time in seconds.
double x
 View-relative X coordinate.
double y
 View-relative Y coordinate.
double xRoot
 Root-relative X coordinate.
double yRoot
 Root-relative Y coordinate.
PuglMods state
 Bitwise OR of PuglMod flags.
uint32_t keycode
 Raw key code.
uint32_t key
 Unshifted Unicode character code, or 0.

Detailed Description

Key press or release event.

This event represents low-level key presses and releases. This can be used for "direct" keyboard handing like key bindings, but must not be interpreted as text input.

Keys are represented portably as Unicode code points, using the "natural" code point for the key where possible (see PuglKey for details). The key field is the code for the pressed key, without any modifiers applied. For example, a press or release of the 'A' key will have key 97 ('a') regardless of whether shift or control are being held.

Alternatively, the raw keycode can be used to work directly with physical keys, but note that this value is not portable and differs between platforms and hardware.

Member Data Documentation

◆ flags

PuglEventFlags PuglKeyEvent::flags

Bitwise OR of PuglEventFlag values.

◆ key

uint32_t PuglKeyEvent::key

Unshifted Unicode character code, or 0.

◆ keycode

uint32_t PuglKeyEvent::keycode

Raw key code.

◆ state

PuglMods PuglKeyEvent::state

Bitwise OR of PuglMod flags.

◆ time

double PuglKeyEvent::time

Time in seconds.

◆ type

◆ x

double PuglKeyEvent::x

View-relative X coordinate.

◆ xRoot

double PuglKeyEvent::xRoot

Root-relative X coordinate.

◆ y

double PuglKeyEvent::y

View-relative Y coordinate.

◆ yRoot

double PuglKeyEvent::yRoot

Root-relative Y coordinate.


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