OpenTTD Source 20260704-master-gbf70c61fb8
SDLVkMapping Struct Reference

Mapping from keycodes in the SDL world to OpenTTD's world. More...

Public Member Functions

constexpr SDLVkMapping (SDL_Keycode vk_first, SDL_Keycode vk_last, WindowKeyCodes map_first, WindowKeyCodes map_last, bool unprintable)
 Create a mapping for several consecutive keycodes.
constexpr SDLVkMapping (SDL_Keycode vk_from, WindowKeyCodes map_to, bool unprintable)
 Create a mapping for a single keycode.

Data Fields

const SDL_Keycode vk_from
 The first of the SDL keycodes of this mapping.
const WindowKeyCodes map_to
 The first of the OpenTTD keycodes of this mapping.
const uint8_t count
 The number of keycodes that are to be mapped.
const bool unprintable
 Whether this keycode is unprintable.

Detailed Description

Mapping from keycodes in the SDL world to OpenTTD's world.

Definition at line 266 of file sdl2_v.cpp.

Constructor & Destructor Documentation

◆ SDLVkMapping() [1/2]

SDLVkMapping::SDLVkMapping ( SDL_Keycode vk_first,
SDL_Keycode vk_last,
WindowKeyCodes map_first,
WindowKeyCodes map_last,
bool unprintable )
inlineconstexpr

Create a mapping for several consecutive keycodes.

Parameters
vk_firstThe first SDL keycode.
vk_lastThe last SDL keycode (inclusive).
map_firstThe first OpenTTD keycode.
map_lastThe last OpenTTD keycode (inclusive).
unprintableWhether this keycode is unprintable.

Definition at line 280 of file sdl2_v.cpp.

References count, map_to, unprintable, and vk_from.

◆ SDLVkMapping() [2/2]

SDLVkMapping::SDLVkMapping ( SDL_Keycode vk_from,
WindowKeyCodes map_to,
bool unprintable )
inlineconstexpr

Create a mapping for a single keycode.

Parameters
vk_fromThe SDL keycode.
map_toThe OpenTTD keycode.
unprintableWhether this keycode is unprintable.

Definition at line 294 of file sdl2_v.cpp.

References count, map_to, unprintable, and vk_from.

Field Documentation

◆ count

const uint8_t SDLVkMapping::count

The number of keycodes that are to be mapped.

Definition at line 269 of file sdl2_v.cpp.

Referenced by SDLVkMapping(), and SDLVkMapping().

◆ map_to

const WindowKeyCodes SDLVkMapping::map_to

The first of the OpenTTD keycodes of this mapping.

Definition at line 268 of file sdl2_v.cpp.

Referenced by SDLVkMapping(), and SDLVkMapping().

◆ unprintable

const bool SDLVkMapping::unprintable

Whether this keycode is unprintable.

Definition at line 270 of file sdl2_v.cpp.

Referenced by SDLVkMapping(), and SDLVkMapping().

◆ vk_from

const SDL_Keycode SDLVkMapping::vk_from

The first of the SDL keycodes of this mapping.

Definition at line 267 of file sdl2_v.cpp.

Referenced by SDLVkMapping(), and SDLVkMapping().


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