libevdevxx 0.4.0
A C++ wrapper for libevdev.
Loading...
Searching...
No Matches
Code Struct Reference

Type-safe class for evdev codes (KEY_*, BTN_*, REL_*, etc). More...

#include <Code.hpp>

Public Types

using Base = detail::NumberBase< std::uint16_t, Code >
 
using value_type = typename Base::Value
 The underlying value, same as std::uint16_t.
 

Public Member Functions

 Code (Type type, value_type code_num)
 

Static Public Member Functions

static std::pair< Type, Codeparse (std::string_view name, std::size_t *pos=nullptr)
 Parse a Type and Code from a string.
 
static Code max (Type type)
 Returns the maximum code available for a given type.
 

Detailed Description

Type-safe class for evdev codes (KEY_*, BTN_*, REL_*, etc).

A Code object can only be explicitly constructed from an integer. Conversion back to the integer value is implicit.

Member Typedef Documentation

◆ Base

using Base = detail::NumberBase<std::uint16_t, Code>

◆ value_type

using value_type = typename Base::Value

The underlying value, same as std::uint16_t.

Constructor & Destructor Documentation

◆ Code()

Code ( Type  type,
value_type  code_num 
)

Member Function Documentation

◆ max()

static Code max ( Type  type)
static

Returns the maximum code available for a given type.

◆ parse()

static std::pair< Type, Code > parse ( std::string_view  name,
std::size_t *  pos = nullptr 
)
static

Parse a Type and Code from a string.

Parameters
namethe string to parse.
[out]posif not NULL, store how many characters were parsed.

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