10 #ifndef EVENTTYPECODE_HPP 11 #define EVENTTYPECODE_HPP 13 #include <libevdev/libevdev.h> 22 namespace duds {
namespace os {
namespace linux {
62 std::string
typeName()
const noexcept;
70 std::string
typeName(
const std::string &unknown)
const noexcept;
79 std::string
codeName()
const noexcept;
87 std::string
codeName(
const std::string &unknown)
const noexcept;
113 template<>
struct hash<
duds::os::linux::EventTypeCode> {
120 #endif // #ifndef EVENTTYPECODE_HPP constexpr bool operator!=(EventTypeCode etc) const
Obvious inequality operator.
constexpr EventTypeCode(std::uint16_t t, std::uint16_t c)
Constructs an EventTypeCode pre-filled with an event type and code.
std::string codeName() const noexcept
Returns a string of the macro name for the event code, such as "REL_Y", or an empty string if the cod...
std::uint16_t code
An event code, such as KEY_A, ABS_X, or REL_Y.
constexpr bool operator<(EventTypeCode etc) const
Less-than comparison for EventTypeCode to allow it to be used as a key in a container class...
Combines an event type and an event code, as defined by libevdev, for the purpose of using a combinat...
std::uint16_t type
An event type, such as EV_KEY, EV_ABS, or EV_REL.
std::uint32_t typecode
The combined event type and code.
std::size_t operator()(const duds::os::linux::EventTypeCode &etc) const noexcept
constexpr bool operator==(EventTypeCode etc) const
Obvious equality operator.
EventTypeCode()=default
Makes this type trivially constructable.
std::string typeName() const noexcept
Returns a string of the macro name for the event type, such as "EV_KEY", or an empty string if the ty...