| 39 | } |
| 40 | |
| 41 | bool Window_InputSettings::RemoveMapping() { |
| 42 | int index = GetIndex(); |
| 43 | |
| 44 | int i = 0; |
| 45 | auto& mappings = Input::GetInputSource()->GetButtonMappings(); |
| 46 | for (auto ki = mappings.LowerBound(button); ki != mappings.end() && ki->first == button; ++ki) { |
| 47 | if (i == index) { |
| 48 | auto key = static_cast<Input::Keys::InputKey>(ki->second); |
| 49 | |
| 50 | mappings.Remove({button, key}); |
| 51 | Refresh(); |
| 52 | break; |
| 53 | } |
| 54 | |
| 55 | ++i; |
| 56 | } |
| 57 | |
| 58 | return true; |
| 59 | } |
| 60 | |
| 61 | void Window_InputSettings::ResetMapping() { |
| 62 | Input::ResetDefaultMapping(button); |
no test coverage detected