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

Input bindings and key capture. More...

#include <chrono>
#include <memory>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include <rex/input_keys.h>
#include <rex/platform.h>
#include <rex/result.h>
#include <rex/settings_registry.h>
#include <rex/types.h>

Go to the source code of this file.

Classes

struct  rex::hid::BindingConfig
class  rex::hid::IBindingSet
struct  rex::hid::KeyCaptureConfig
class  rex::hid::IKeyCapture

Namespaces

namespace  rex

Functions

constexpr u8 rex::hid::GetAxisSlot (u8 direction, u8 alternate)
constexpr u8 rex::hid::GetAxisDirection (u8 axis_slot)
REX_HID_API std::span< const VirtualKey > rex::hid::GetBindableKeys ()

Variables

constexpr u8 rex::hid::kAxisDirections = 4
constexpr u8 rex::hid::kAxisKeysPerDirection = 2
constexpr u8 rex::hid::kMaxAxisKeyHalves = kAxisDirections * kAxisKeysPerDirection

Detailed Description

Input bindings and key capture.

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

Function Documentation

◆ GetAxisDirection()

u8 rex::hid::GetAxisDirection ( u8 axis_slot)
constexpr

Returns the direction of a stick row slot, 0 to kAxisDirections - 1.

Parameters
axis_slotA 1 based slot from InputSource::axis_slot.

◆ GetAxisSlot()

u8 rex::hid::GetAxisSlot ( u8 direction,
u8 alternate )
constexpr

Returns the stick row slot of a key half. The slot is 1 based, to store in InputSource::axis_slot.

Parameters
directionThe direction, 0 to kAxisDirections - 1.
alternateWhich key of the direction, 0 for the first and 1 for the second.

◆ GetBindableKeys()

REX_HID_API std::span< const VirtualKey > rex::hid::GetBindableKeys ( )

Returns the keys and mouse buttons a binding can name, in ascending VirtualKey order. Modifier keys are not listed.