evan 2026.1.4
Evan
Loading...
Searching...
No Matches
XrManageButtonsActions.hpp
1/*
2** ETIB PROJECT, 2026
3** evan
4** File description:
5** XrManageButtonsActions
6*/
7
8#pragma once
9
10#include <utility/logging/loggable.hpp>
11#include <utility/logging/default_logger.hpp>
12
13#include "evan/EvanPlatform.hpp"
14
15#include <utility/event/hand_motion_event.hpp>
16
17#include "evan/openxr/actions/AXrAction.hpp"
18#include "evan/openxr/InteractionProfile.hpp"
19
20namespace evan
21{
22
23 class XrDeviceBackend;
24
37 {
38 public:
46 XrButtonAction(utility::event::HandButtonEvent::Button buttonType =
47 utility::event::HandButtonEvent::Button::Unknown);
48
52 ~XrButtonAction() = default;
53
71 std::vector<std::shared_ptr<utility::event::Event>>
73 std::shared_ptr<utility::event::HandMotionEvent>
74 handMotionEvent) override;
75
76 private:
77 utility::event::HandButtonEvent::Button
78 _buttonType;
80 bool _lastState { false };
82 };
83
100 protected utility::logging::Loggable<XrManageButtonsActions,
101 utility::logging::DefaultLogger>
102 {
103 public:
119
128
147 std::vector<std::shared_ptr<utility::event::Event>>
149 std::shared_ptr<utility::event::HandMotionEvent>
151 std::shared_ptr<utility::event::HandMotionEvent>
153
161 std::unique_ptr<XrButtonAction> _buttonAAction;
162
170 std::unique_ptr<XrButtonAction> _buttonBAction;
171
179 std::unique_ptr<XrButtonAction> _buttonXAction;
180
188 std::unique_ptr<XrButtonAction> _buttonYAction;
189
198 std::unique_ptr<XrButtonAction> _buttonMenuAction;
199
208 std::unique_ptr<XrButtonAction> _buttonSystemAction;
209
210 private:
211 };
212} // namespace evan
Represents an OpenXR action and its associated properties.
Definition AXrAction.hpp:39
The XrButtonAction class represents an individual button action in an OpenXR application.
std::vector< std::shared_ptr< utility::event::Event > > getEvent(XrDeviceBackend &deviceBackend, std::shared_ptr< utility::event::HandMotionEvent > handMotionEvent) override
Retrieves the current state of the A button action and generates corresponding events.
~XrButtonAction()=default
Destructor for the XrButtonAAction class.
The XrDeviceBackend class is responsible for managing the OpenXR device backend, including instance c...
The XrManageButtonsActions class is responsible for managing button actions in an OpenXR application....
std::unique_ptr< XrButtonAction > _buttonXAction
Unique pointer to the action associated with the X button.
std::unique_ptr< XrButtonAction > _buttonAAction
Unique pointer to the action associated with the A button.
std::vector< std::shared_ptr< utility::event::Event > > getEvents(XrDeviceBackend &deviceBackend, std::shared_ptr< utility::event::HandMotionEvent > handMotionLeftEvent, std::shared_ptr< utility::event::HandMotionEvent > handMotionRightEvent)
Retrieves the current state of the button actions and generates corresponding events.
~XrManageButtonsActions()
Destructor for the XrManageButtonsActions class. This destructor is responsible for cleaning up any r...
std::unique_ptr< XrButtonAction > _buttonMenuAction
Unique pointer to the action associated with the System button.
std::unique_ptr< XrButtonAction > _buttonYAction
Unique pointer to the action associated with the Menu button.
std::unique_ptr< XrButtonAction > _buttonSystemAction
Unique pointer to the action associated with the System button.
std::unique_ptr< XrButtonAction > _buttonBAction
Unique pointer to the action associated with the B button.
Small result wrapper used by helpers that must return both a status and a value (e....
Definition Error.hpp:89