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

The SDL keyboard scancode representation. More...

Public Member Functions

constexpr Scancode (SDL_Scancode scancode={})
 Wraps Scancode.
 
 Scancode (StringParam name)
 Get a scancode from a human-readable name.
 
constexpr auto operator<=> (const Scancode &other) const =default
 Default comparison operator.
 
constexpr auto operator<=> (SDL_Scancode scancode) const
 Compares with the underlying type.
 
constexpr operator SDL_Scancode () const
 Unwraps to the underlying Scancode.
 
constexpr operator bool () const
 Check if valid.
 
void SetName (StringParam name)
 Set a human-readable name for a scancode.
 
const char * GetName () const
 Get a human-readable name for a scancode.
 

Detailed Description

An SDL scancode is the physical representation of a key on the keyboard, independent of language and keyboard mapping.

Values of this type are used to represent keyboard keys, among other places in the scancode field of the KeyboardEvent structure.

The values in this enumeration are based on the USB usage page standard: https://usb.org/sites/default/files/hut1_5.pdf

Since
This enum is available since SDL 3.2.0.

Constructor & Destructor Documentation

◆ Scancode()

constexpr SDL::Scancode::Scancode ( SDL_Scancode  scancode = {})
inlineconstexpr
Parameters
scancodethe value to be wrapped

Member Function Documentation

◆ operator bool()

constexpr SDL::Scancode::operator bool ( ) const
inlineexplicitconstexpr
Returns
True if valid state, false otherwise.

◆ operator SDL_Scancode()

constexpr SDL::Scancode::operator SDL_Scancode ( ) const
inlineconstexpr
Returns
the underlying Scancode.

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