// SPDX-FileCopyrightText: 2002-2026 PCSX2 Dev Team // SPDX-License-Identifier: GPL-3.0+ #pragma once #include "common/Pcsx2Defs.h" #include class PadData { public: /// Create a struct containing the PAD data from the global PAD state /// see - `g_key_status` PadData(const int port, const int slot); PadData(const int port, const int slot, const std::array data); /// Constants static constexpr u8 ANALOG_VECTOR_NEUTRAL = 127; int m_ext_port; int m_port; int m_slot; // Analog Sticks - - 0-255 (127 center) std::tuple m_rightAnalog = {ANALOG_VECTOR_NEUTRAL, ANALOG_VECTOR_NEUTRAL}; std::tuple m_leftAnalog = {ANALOG_VECTOR_NEUTRAL, ANALOG_VECTOR_NEUTRAL}; u8 m_compactPressFlagsGroupOne = 255; u8 m_compactPressFlagsGroupTwo = 255; // Buttons std::tuple m_circle = {false, 0}; std::tuple m_cross = {false, 0}; std::tuple m_square = {false, 0}; std::tuple m_triangle = {false, 0}; std::tuple m_down = {false, 0}; std::tuple m_left = {false, 0}; std::tuple m_right = {false, 0}; std::tuple m_up = {false, 0}; std::tuple m_l1 = {false, 0}; std::tuple m_l2 = {false, 0}; std::tuple m_r1 = {false, 0}; std::tuple m_r2 = {false, 0}; // Buttons bool m_start = false; bool m_select = false; bool m_l3 = false; bool m_r3 = false; // Overrides the actual controller's state with the the values in this struct void OverrideActualController() const; // Prints current PadData to the Controller Log filter which is disabled by default void LogPadData() const; };