| 843 | |
| 844 | bool InputSubsystem::IsActionBoundToRecentAxis(UserAction action) const |
| 845 | { |
| 846 | const int idx = static_cast<int>(context_); |
| 847 | if (idx < 0 || idx >= kNumContexts) |
| 848 | return false; |
| 849 | |
| 850 | const auto& bindings = profiles_[idx].GetBindingEntries(action); |
| 851 | for (const InputBinding& binding : bindings) |
| 852 | { |
| 853 | int key = binding.code.toLegacy(); |
| 854 | if ((key & INPUT_DEVICE_MASK) == INPUT_DEVICE_STICK_AXIS) |
| 855 | { |
| 856 | int axis = key - INPUT_DEVICE_STICK_AXIS; |
| 857 | if (axis >= 0 && axis < N_JOYSTICK_AXES) |
| 858 | { |
| 859 | if (GInput.gamepad.jAxisLastActive[axis] >= Glob.uiTime - 0.1) |
| 860 | return true; |
| 861 | } |
| 862 | } |
| 863 | } |
| 864 | return false; |
| 865 | } |
| 866 | |
| 867 | float InputSubsystem::GetStickForward() const |
| 868 | { |
| 869 | float legacyAxis = -GetAction(UAAxisDive, true); |
no test coverage detected