libvirtualhid 19
Cross-platform C++ library for virtual HID devices.
lvh::ButtonSet Class Reference

Compact set of pressed gamepad buttons. More...

#include <src/include/libvirtualhid/types.hpp>

Public Member Functions

void clear ()
 Clear all buttons.
 
std::uint32_t raw_bits () const
 Get the raw bitset value.
 
void reset (GamepadButton button)
 Clear a button.
 
void set (GamepadButton button, bool pressed=true)
 Set or clear a button.
 
bool test (GamepadButton button) const
 Check whether a button is pressed.
 

Detailed Description

Compact set of pressed gamepad buttons.

Member Function Documentation

◆ raw_bits()

std::uint32_t lvh::ButtonSet::raw_bits ( ) const

Get the raw bitset value.

Returns
Raw button bits.

◆ reset()

void lvh::ButtonSet::reset ( GamepadButton button)

Clear a button.

Parameters
buttonButton to clear.

◆ set()

void lvh::ButtonSet::set ( GamepadButton button,
bool pressed = true )

Set or clear a button.

Parameters
buttonButton to update.
pressedWhether the button is pressed.

◆ test()

bool lvh::ButtonSet::test ( GamepadButton button) const

Check whether a button is pressed.

Parameters
buttonButton to test.
Returns
true when the button is pressed.

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