MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / convert_button

Method convert_button

source/MaaGamepadControlUnit/Input/GamepadState.cpp:112–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112uint16_t Ds4GamepadState::convert_button(int button)
113{
114 uint16_t result = 0;
115
116 if (button & XBOX_A) {
117 result |= DS4_CROSS;
118 }
119 if (button & XBOX_B) {
120 result |= DS4_CIRCLE;
121 }
122 if (button & XBOX_X) {
123 result |= DS4_SQUARE;
124 }
125 if (button & XBOX_Y) {
126 result |= DS4_TRIANGLE;
127 }
128 if (button & XBOX_LEFT_SHOULDER) {
129 result |= DS4_L1;
130 }
131 if (button & XBOX_RIGHT_SHOULDER) {
132 result |= DS4_R1;
133 }
134 if (button & XBOX_LEFT_THUMB) {
135 result |= DS4_L_THUMB;
136 }
137 if (button & XBOX_RIGHT_THUMB) {
138 result |= DS4_R_THUMB;
139 }
140 if (button & XBOX_START) {
141 result |= DS4_OPTIONS;
142 }
143 if (button & XBOX_BACK) {
144 result |= DS4_SHARE;
145 }
146
147 return result;
148}
149
150uint8_t Ds4GamepadState::convert_special(int button)
151{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected