feat(input/linux): add support for more virtual input devices (#2606)
Co-authored-by: ABeltramo <beltramo.ale@gmail.com> Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
@@ -80,6 +80,12 @@ namespace platf {
|
||||
constexpr std::uint32_t TOUCHPAD_BUTTON = 0x100000;
|
||||
constexpr std::uint32_t MISC_BUTTON = 0x200000;
|
||||
|
||||
struct supported_gamepad_t {
|
||||
std::string name;
|
||||
bool is_enabled;
|
||||
std::string reason_disabled;
|
||||
};
|
||||
|
||||
enum class gamepad_feedback_e {
|
||||
rumble,
|
||||
rumble_triggers,
|
||||
@@ -695,9 +701,9 @@ namespace platf {
|
||||
void
|
||||
hscroll(input_t &input, int distance);
|
||||
void
|
||||
keyboard(input_t &input, uint16_t modcode, bool release, uint8_t flags);
|
||||
keyboard_update(input_t &input, uint16_t modcode, bool release, uint8_t flags);
|
||||
void
|
||||
gamepad(input_t &input, int nr, const gamepad_state_t &gamepad_state);
|
||||
gamepad_update(input_t &input, int nr, const gamepad_state_t &gamepad_state);
|
||||
void
|
||||
unicode(input_t &input, char *utf8, int size);
|
||||
|
||||
@@ -718,7 +724,7 @@ namespace platf {
|
||||
* @param touch The touch event.
|
||||
*/
|
||||
void
|
||||
touch(client_input_t *input, const touch_port_t &touch_port, const touch_input_t &touch);
|
||||
touch_update(client_input_t *input, const touch_port_t &touch_port, const touch_input_t &touch);
|
||||
|
||||
/**
|
||||
* @brief Sends a pen event to the OS.
|
||||
@@ -727,7 +733,7 @@ namespace platf {
|
||||
* @param pen The pen event.
|
||||
*/
|
||||
void
|
||||
pen(client_input_t *input, const touch_port_t &touch_port, const pen_input_t &pen);
|
||||
pen_update(client_input_t *input, const touch_port_t &touch_port, const pen_input_t &pen);
|
||||
|
||||
/**
|
||||
* @brief Sends a gamepad touch event to the OS.
|
||||
@@ -784,6 +790,10 @@ namespace platf {
|
||||
[[nodiscard]] std::unique_ptr<deinit_t>
|
||||
init();
|
||||
|
||||
std::vector<std::string_view> &
|
||||
supported_gamepads();
|
||||
/**
|
||||
* @brief Gets the supported gamepads for this platform backend.
|
||||
* @return Vector of gamepad options and status.
|
||||
*/
|
||||
std::vector<supported_gamepad_t> &
|
||||
supported_gamepads(input_t *input);
|
||||
} // namespace platf
|
||||
|
||||
Reference in New Issue
Block a user