| 384 | else release(key->key()); |
| 385 | } |
| 386 | private: |
| 387 | #ifdef Q_KEYEDIT_PAD_ENABLED |
| 388 | private Q_SLOTS: |
| 389 | void XBoxPadStateTimer() |
| 390 | { |
| 391 | if (m_editable && m_pad && !m_combination) |
| 392 | { |
| 393 | XINPUT_STATE state = {}; |
| 394 | if (XInputGetState(0, &state) == NO_ERROR) |
| 395 | { |
| 396 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_START) > m_state[XBoxPadButton::start]) |
| 397 | press(XBoxPadButton::start); |
| 398 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_START) < m_state[XBoxPadButton::start]) |
| 399 | release(XBoxPadButton::start); |
| 400 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_BACK) > m_state[XBoxPadButton::back]) |
| 401 | press(XBoxPadButton::back); |
| 402 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_BACK) < m_state[XBoxPadButton::back]) |
| 403 | release(XBoxPadButton::back); |
| 404 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_A) > m_state[XBoxPadButton::a]) |
| 405 | press(XBoxPadButton::a); |
| 406 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_A) < m_state[XBoxPadButton::a]) |
| 407 | release(XBoxPadButton::a); |
| 408 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_B) > m_state[XBoxPadButton::b]) |
| 409 | press(XBoxPadButton::b); |
| 410 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_B) < m_state[XBoxPadButton::b]) |
| 411 | release(XBoxPadButton::b); |
| 412 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_X) > m_state[XBoxPadButton::x]) |
| 413 | press(XBoxPadButton::x); |
| 414 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_X) < m_state[XBoxPadButton::x]) |
| 415 | release(XBoxPadButton::x); |
| 416 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_Y) > m_state[XBoxPadButton::y]) |
| 417 | press(XBoxPadButton::y); |
| 418 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_Y) < m_state[XBoxPadButton::y]) |
| 419 | release(XBoxPadButton::y); |
| 420 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) > m_state[XBoxPadButton::up]) |
| 421 | press(XBoxPadButton::up); |
| 422 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP) < m_state[XBoxPadButton::up]) |
| 423 | release(XBoxPadButton::up); |
| 424 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN) > m_state[XBoxPadButton::down]) |
| 425 | press(XBoxPadButton::down); |
| 426 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_DOWN) < m_state[XBoxPadButton::down]) |
| 427 | release(XBoxPadButton::down); |
| 428 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) > m_state[XBoxPadButton::left]) |
| 429 | press(XBoxPadButton::left); |
| 430 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_LEFT) < m_state[XBoxPadButton::left]) |
| 431 | release(XBoxPadButton::left); |
| 432 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) > m_state[XBoxPadButton::right]) |
| 433 | press(XBoxPadButton::right); |
| 434 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_RIGHT) < m_state[XBoxPadButton::right]) |
| 435 | release(XBoxPadButton::right); |
| 436 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) > m_state[XBoxPadButton::l_joy_press]) |
| 437 | press(XBoxPadButton::l_joy_press); |
| 438 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) < m_state[XBoxPadButton::l_joy_press]) |
| 439 | release(XBoxPadButton::l_joy_press); |
| 440 | if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) > m_state[XBoxPadButton::r_joy_press]) |
| 441 | press(XBoxPadButton::r_joy_press); |
| 442 | else if ((state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) < m_state[XBoxPadButton::r_joy_press]) |
| 443 | release(XBoxPadButton::r_joy_press); |
nothing calls this directly
no outgoing calls
no test coverage detected