| 38 | } // namespace |
| 39 | |
| 40 | void ControlsConfig::LoadDefaults() |
| 41 | { |
| 42 | UserActionDesc* descs = InputSubsystem::GetUserActionDesc(); |
| 43 | for (int i = 0; i < UAN; i++) |
| 44 | { |
| 45 | // Pull only the keyboard / mouse defaults — joystick defaults |
| 46 | // ride along in GamepadConfig::LoadDefaults. |
| 47 | bindings[i].Resize(0); |
| 48 | modifiers[i].Resize(0); |
| 49 | const KeyList& src = descs[i].keys; |
| 50 | for (int j = 0; j < src.Size(); j++) |
| 51 | { |
| 52 | if (IsKbmCode(src[j])) |
| 53 | { |
| 54 | bindings[i].Add(src[j]); |
| 55 | modifiers[i].Add(-1); |
| 56 | } |
| 57 | } |
| 58 | bindings[i].Compact(); |
| 59 | modifiers[i].Compact(); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | bool ControlsConfig::Load(const std::string& path) |
| 64 | { |