Antkeeper  0.0.1
Public Member Functions | Public Attributes | List of all members
input::key_mapping Class Reference

Maps a keyboard key to a control input value. More...

#include <mapping.hpp>

Inheritance diagram for input::key_mapping:
input::mapping

Public Member Functions

constexpr mapping_type get_mapping_type () const noexcept override
 Returns mapping_type::key. More...
 
 key_mapping (input::keyboard *keyboard, input::scancode scancode, std::uint16_t modifiers=0, bool repeat=false)
 Constructs a key mapping. More...
 
 key_mapping ()=default
 Constructs a key mapping. More...
 
- Public Member Functions inherited from input::mapping
 mapping ()=default
 Constructs an input mapping. More...
 
virtual ~mapping ()=default
 Destructs an input mapping. More...
 

Public Attributes

input::keyboardkeyboard {nullptr}
 Pointer to the mapped keyboard, or nullptr if input from any keyboard is accepted. More...
 
scancode scancode {0}
 Scancode of the mapped key. More...
 
std::uint16_t modifiers {0}
 Modifier keys bitbask. More...
 
bool repeat {false}
 false if the mapping ignores key repeats, true otherwise. More...
 

Detailed Description

Maps a keyboard key to a control input value.

Definition at line 124 of file mapping.hpp.

Constructor & Destructor Documentation

◆ key_mapping() [1/2]

input::key_mapping::key_mapping ( input::keyboard keyboard,
input::scancode  scancode,
std::uint16_t  modifiers = 0,
bool  repeat = false 
)

Constructs a key mapping.

Parameters
keyboardPointer to the keyboard to map, or nullptr if input from any keyboard will be mapped.
scancodeScancode of the key to map.
repeatfalse if the mapping should ignore key repeats, true otherwise.
modifiersModifier keys bitmask.

Definition at line 39 of file mapping.cpp.

◆ key_mapping() [2/2]

input::key_mapping::key_mapping ( )
default

Constructs a key mapping.

Parameters
keyboardPointer to the keyboard to map, or nullptr if input from any keyboard will be mapped.
scancodeScancode of the key to map.
repeatfalse if the mapping should ignore key repeats, true otherwise.
modifiersModifier keys bitmask.

Member Function Documentation

◆ get_mapping_type()

constexpr mapping_type input::key_mapping::get_mapping_type ( ) const
inlineconstexproverridevirtualnoexcept

Returns mapping_type::key.

Implements input::mapping.

Definition at line 141 of file mapping.hpp.

Member Data Documentation

◆ keyboard

input::keyboard* input::key_mapping::keyboard {nullptr}

Pointer to the mapped keyboard, or nullptr if input from any keyboard is accepted.

Definition at line 147 of file mapping.hpp.

◆ modifiers

std::uint16_t input::key_mapping::modifiers {0}

Modifier keys bitbask.

Definition at line 153 of file mapping.hpp.

◆ repeat

bool input::key_mapping::repeat {false}

false if the mapping ignores key repeats, true otherwise.

Definition at line 156 of file mapping.hpp.

◆ scancode

scancode input::key_mapping::scancode {0}

Scancode of the mapped key.

Definition at line 150 of file mapping.hpp.


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