ReXGlue SDK
Loading...
Searching...
No Matches
pad.h File Reference

Pad state, capabilities and identity. More...

#include <string>
#include <rex/bit.h>
#include <rex/types.h>

Go to the source code of this file.

Classes

struct  rex::hid::PadState
struct  rex::hid::PadVibration
struct  rex::hid::PadCapabilities
struct  rex::hid::PadKeystroke
struct  rex::hid::PadInfo
struct  rex::hid::PadDeviceID
struct  rex::hid::PadIdentity
struct  rex::hid::PadDevice

Namespaces

namespace  rex

Enumerations

enum  rex::hid::PadButton : u16 {
  kPadDPadUp = 0x0001 , kPadDPadDown = 0x0002 , kPadDPadLeft = 0x0004 , kPadDPadRight = 0x0008 ,
  kPadStart = 0x0010 , kPadBack = 0x0020 , rex::hid::kPadLeftThumb = 0x0040 , rex::hid::kPadRightThumb = 0x0080 ,
  kPadLeftShoulder = 0x0100 , kPadRightShoulder = 0x0200 , kPadGuide = 0x0400 , kPadA = 0x1000 ,
  kPadB = 0x2000 , kPadX = 0x4000 , kPadY = 0x8000
}
enum class  rex::hid::KeystrokeSource : u8 { kNone = 0x00 , kPad = 0x01 , kKeyboard = 0x02 }
enum class  rex::hid::PadType : u8 {
  kUnknown , kStandard , kX360 , kXOne ,
  kPS3 , kPS4 , kPS5 , kSwitchPro ,
  kSwitchJoyCon
}

Functions

template<FlagsEnum E>
constexpr bool rex::hid::HasFlags (E value, E flags)
template<FlagsEnum E>
constexpr E rex::hid::operator| (E lhs, E rhs)
template<FlagsEnum E>
constexpr E rex::hid::operator& (E lhs, E rhs)
template<FlagsEnum E>
constexpr E rex::hid::operator^ (E lhs, E rhs)
template<FlagsEnum E>
constexpr E rex::hid::operator~ (E value)
template<FlagsEnum E>
constexpr E & rex::hid::operator|= (E &lhs, E rhs)
template<FlagsEnum E>
constexpr E & rex::hid::operator&= (E &lhs, E rhs)
template<FlagsEnum E>
constexpr E & rex::hid::operator^= (E &lhs, E rhs)

Variables

constexpr PadDeviceID rex::hid::kInvalidPadDeviceID {}

Detailed Description

Pad state, capabilities and identity.

License
BSD 3-Clause License See LICENSE file in the project root for full license text.

Enumeration Type Documentation

◆ KeystrokeSource

enum class rex::hid::KeystrokeSource : u8
strong

The devices a keystroke can come from.

Enumerator
kNone 

No source.

kPad 

Controller keys: buttons and sticks made into keystrokes.

kKeyboard 

Keyboard and chatpad text.

◆ PadButton

enum rex::hid::PadButton : u16

Button bits of PadState::buttons. The layout matches the title's input API.

Enumerator
kPadLeftThumb 

Left stick press.

kPadRightThumb 

Right stick press.

◆ PadType

enum class rex::hid::PadType : u8
strong

The pad family, for button glyphs.

Function Documentation

◆ HasFlags()

template<FlagsEnum E>
bool rex::HasFlags ( E value,
E flags )
nodiscardconstexpr

Reports whether a set holds every flag of another set.

◆ operator&=()

template<FlagsEnum E>
E & rex::operator&= ( E & lhs,
E rhs )
constexpr

Keeps only the flags of a set that another set holds, in place.

Returns
lhs.

◆ operator^=()

template<FlagsEnum E>
E & rex::operator^= ( E & lhs,
E rhs )
constexpr

Toggles flags of a set in place.

Returns
lhs.

◆ operator|=()

template<FlagsEnum E>
E & rex::operator|= ( E & lhs,
E rhs )
constexpr

Adds flags to a set in place.

Returns
lhs.

Variable Documentation

◆ kInvalidPadDeviceID

PadDeviceID rex::hid::kInvalidPadDeviceID {}
inlineconstexpr

The id that names no pad.