| 324 | } |
| 325 | |
| 326 | static bool ProfileModifierHeld(const Input& in, InputCode modifier, bool checkFocus) |
| 327 | { |
| 328 | if (!modifier.valid()) |
| 329 | return true; |
| 330 | const int packed = modifier.toLegacy(); |
| 331 | const int value = InputBindingValue(packed); |
| 332 | switch (InputBindingDevice(packed)) |
| 333 | { |
| 334 | case INPUT_DEVICE_KEYBOARD: |
| 335 | return QueryKey(in, value, checkFocus) > 0.0f; |
| 336 | case INPUT_DEVICE_MOUSE: |
| 337 | return QueryMouseButton(in, value, checkFocus) > 0.0f; |
| 338 | case INPUT_DEVICE_STICK: |
| 339 | return QueryJoystickButton(in, value, checkFocus) > 0.0f; |
| 340 | case INPUT_DEVICE_STICK_AXIS: |
| 341 | return value >= 0 && value < N_JOYSTICK_AXES && std::fabs(in.gamepad.stickAxis[value]) > 0.8f; |
| 342 | case INPUT_DEVICE_STICK_POV: |
| 343 | return value >= 0 && value < N_JOYSTICK_POV && in.gamepad.stickPov[value]; |
| 344 | default: |
| 345 | return false; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | static float QueryProfileCode(const Input& in, InputCode code, bool checkFocus) |
| 350 | { |
no test coverage detected