Implement extended controller button support

This commit is contained in:
Cameron Gutman
2023-06-25 17:35:56 -05:00
parent 737be029ec
commit feedede6f9
3 changed files with 28 additions and 18 deletions

View File

@@ -254,7 +254,7 @@ namespace input {
<< "--begin controller packet--"sv << std::endl
<< "controllerNumber ["sv << packet->controllerNumber << ']' << std::endl
<< "activeGamepadMask ["sv << util::hex(packet->activeGamepadMask).to_string_view() << ']' << std::endl
<< "buttonFlags ["sv << util::hex(packet->buttonFlags).to_string_view() << ']' << std::endl
<< "buttonFlags ["sv << util::hex((uint32_t) packet->buttonFlags | (packet->buttonFlags2 << 16)).to_string_view() << ']' << std::endl
<< "leftTrigger ["sv << util::hex(packet->leftTrigger).to_string_view() << ']' << std::endl
<< "rightTrigger ["sv << util::hex(packet->rightTrigger).to_string_view() << ']' << std::endl
<< "leftStickX ["sv << packet->leftStickX << ']' << std::endl
@@ -691,8 +691,9 @@ namespace input {
}
std::uint16_t bf = packet->buttonFlags;
std::uint32_t bf2 = packet->buttonFlags2;
platf::gamepad_state_t gamepad_state {
bf,
bf | (bf2 << 16),
packet->leftTrigger,
packet->rightTrigger,
packet->leftStickX,