mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-21 22:13:12 -07:00
Add L2 and R2
This commit is contained in:
parent
e37ac7bc77
commit
00a4870714
5 changed files with 57 additions and 7 deletions
|
@ -123,6 +123,8 @@ void StreamSession::UpdateGamepads()
|
|||
connect(gamepad, &QGamepad::buttonDownChanged, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonL1Changed, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonR1Changed, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonL1Changed, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonL2Changed, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonL3Changed, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonR3Changed, this, &StreamSession::SendFeedbackState);
|
||||
connect(gamepad, &QGamepad::buttonStartChanged, this, &StreamSession::SendFeedbackState);
|
||||
|
@ -159,6 +161,8 @@ void StreamSession::SendFeedbackState()
|
|||
state.buttons |= gamepad->buttonStart() ? CHIAKI_CONTROLLER_BUTTON_OPTIONS : 0;
|
||||
state.buttons |= gamepad->buttonSelect() ? CHIAKI_CONTROLLER_BUTTON_SHARE : 0;
|
||||
state.buttons |= gamepad->buttonGuide() ? CHIAKI_CONTROLLER_BUTTON_PS : 0;
|
||||
state.l2_state = (uint8_t)(gamepad->buttonL2() * 0xff);
|
||||
state.r2_state = (uint8_t)(gamepad->buttonR2() * 0xff);
|
||||
state.left_x = static_cast<int16_t>(gamepad->axisLeftX() * 0x7fff);
|
||||
state.left_y = static_cast<int16_t>(gamepad->axisLeftY() * 0x7fff);
|
||||
state.right_x = static_cast<int16_t>(gamepad->axisRightX() * 0x7fff);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue