| 134 | return std::find(binds.begin(), binds.end(), binding) != binds.end(); |
| 135 | } |
| 136 | |
| 137 | int InputProfile::BindingCount(UserAction action) const |
| 138 | { |
| 139 | int idx = static_cast<int>(action); |
| 140 | if (idx < 0 || idx >= UAN) |
| 141 | return 0; |
| 142 | return static_cast<int>(bindings_[idx].size()); |
| 143 | } |
| 144 | |
| 145 | void InputProfile::LoadDefaults() |
| 146 | { |
| 147 | ClearAll(); |
| 148 | UserActionDesc* descs = InputSubsystem::GetUserActionDesc(); |
| 149 | for (int i = 0; i < UAN; i++) |
| 150 | { |
| 151 | const KeyList& keys = descs[i].keys; |
| 152 | for (int j = 0; j < keys.Size(); j++) |
| 153 | { |
| 154 | if (IsLegacyGamepadCode(keys[j])) |
| 155 | continue; |
no test coverage detected