Louvre  v2.9.0-1
C++ library for Wayland compositors
Public Types | Public Member Functions | List of all members
LKeyboardKeyEvent Class Referencefinal

Keyboard key event. More...

+ Inheritance diagram for LKeyboardKeyEvent:

Public Types

enum  State : UInt32
 Key states. More...
 
- Public Types inherited from LEvent
enum class  Type : UInt8
 Defines the type of event. More...
 
enum class  Subtype : UInt8
 Defines the subtype of event. More...
 

Public Member Functions

 LKeyboardKeyEvent (UInt32 keyCode=0, State state=Pressed, UInt32 serial=LTime::nextSerial(), UInt32 ms=LTime::ms(), UInt64 us=LTime::us(), LInputDevice *device=nullptr) noexcept
 Constructor for LKeyboardKeyEvent. More...
 
void setKeyCode (UInt32 keyCode) noexcept
 Sets the raw key code. More...
 
UInt32 keyCode () const noexcept
 Gets the raw key code. More...
 
void setState (State state) noexcept
 Sets the state of the key. More...
 
State state () const noexcept
 Gets the state of the key. More...
 
- Public Member Functions inherited from LInputEvent
void setDevice (LInputDevice *device) noexcept
 Sets the input device that originated the event. More...
 
LInputDevicedevice () const noexcept
 Gets the input device that originated this event. More...
 
- Public Member Functions inherited from LEvent
 ~LEvent () noexcept=default
 Destructor. More...
 
Type type () const noexcept
 Retrieves the type of the event. More...
 
Subtype subtype () const noexcept
 Retrieves the subtype of the event. More...
 
void setSerial (UInt32 serial) noexcept
 Sets the serial of the event. More...
 
UInt32 serial () const noexcept
 Retrieves the serial of the event. More...
 
void setMs (UInt32 ms) noexcept
 Sets the time the event was generated in milliseconds. More...
 
UInt32 ms () const noexcept
 Retrieves the time the event was generated in milliseconds. More...
 
void setUs (UInt32 us) noexcept
 Sets the time the event was generated in microseconds. More...
 
UInt64 us () const noexcept
 Retrieves the time the event was generated in microseconds. More...
 
LEventcopy () const noexcept
 Creates a deep copy of the event. More...
 

Detailed Description

Keyboard key event.

Member Enumeration Documentation

◆ State

enum State : UInt32

Key states.

Enum with the possible states of a key.

Enumerator
Released 

The key is not being pressed.

Pressed 

The key is pressed.

Constructor & Destructor Documentation

◆ LKeyboardKeyEvent()

LKeyboardKeyEvent ( UInt32  keyCode = 0,
State  state = Pressed,
UInt32  serial = LTime::nextSerial(),
UInt32  ms = LTime::ms(),
UInt64  us = LTime::us(),
LInputDevice device = nullptr 
)
inlinenoexcept

Constructor for LKeyboardKeyEvent.

Parameters
keyCodeThe raw key code.
stateThe state of the key (Pressed or Released).
serialThe serial number of the event.
msThe millisecond timestamp of the event.
usThe microsecond timestamp of the event.
deviceThe input device that originated the event.

Member Function Documentation

◆ setKeyCode()

void setKeyCode ( UInt32  keyCode)
inlinenoexcept

Sets the raw key code.

◆ keyCode()

UInt32 keyCode ( ) const
inlinenoexcept

Gets the raw key code.

◆ setState()

void setState ( State  state)
inlinenoexcept

Sets the state of the key.

◆ state()

State state ( ) const
inlinenoexcept

Gets the state of the key.