9#ifndef LIBEVDEVXX_CODE_HPP
10#define LIBEVDEVXX_CODE_HPP
19#include "detail/NumberBase.hpp"
32 public detail::NumberBase<std::uint16_t, Code> {
34 using Base = detail::NumberBase<std::uint16_t, Code>;
59 std::size_t* pos =
nullptr);
The namespace of libevdevxx.
Definition: AbsInfo.hpp:20
std::string code_to_string(Type type, Code code)
Converts the code to a string representation.
Type-safe class for evdev codes (KEY_*, BTN_*, REL_*, etc).
Definition: Code.hpp:32
detail::NumberBase< std::uint16_t, Code > Base
Definition: Code.hpp:34
typename Base::Value value_type
The underlying value, same as std::uint16_t.
Definition: Code.hpp:37
static std::pair< Type, Code > parse(std::string_view name, std::size_t *pos=nullptr)
Parse a Type and Code from a string.
Code(Type type, value_type code_num)
static Code max(Type type)
Returns the maximum code available for a given type.