SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::Keycode Class Reference

The SDL virtual key representation. More...

Public Member Functions

constexpr Keycode (KeycodeRaw keycode={}) noexcept
 Wraps Keycode. More...
 
 Keycode (Scancode scancode, Keymod modstate, bool key_event)
 Get the key code corresponding to the given scancode according to the current keyboard layout. More...
 
 Keycode (StringParam name)
 Get a key code from a human-readable name. More...
 
constexpr operator KeycodeRaw () const noexcept
 Unwraps to the underlying Keycode. More...
 
constexpr bool IsExtended () const
 Has Extended flag.
 
constexpr bool IsScancode () const
 Has Scancode flag.
 
Scancode GetScancode (Keymod *modstate) const
 Get the scancode corresponding to the given key code according to the current keyboard layout. More...
 
const char * GetName () const
 Get a human-readable name for a key. More...
 

Detailed Description

Values of this type are used to represent keyboard keys using the current layout of the keyboard. These values include Unicode values representing the unmodified character that would be generated by pressing the key, or an SDLK_* constant for those keys that do not generate characters.

A special exception is the number keys at the top of the keyboard which map to SDLK_0...SDLK_9 on AZERTY layouts.

Keys with the SDLK_EXTENDED_MASK bit set do not map to a scancode or unicode code point.

Since
This datatype is available since SDL 3.2.0.

Constructor & Destructor Documentation

◆ Keycode()

constexpr SDL::Keycode::Keycode ( KeycodeRaw  keycode = {})
inlineconstexprnoexcept
Parameters
keycodethe value to be wrapped

Member Function Documentation

◆ operator KeycodeRaw()

constexpr SDL::Keycode::operator KeycodeRaw ( ) const
inlineconstexprnoexcept
Returns
the underlying KeycodeRaw.

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