MCPcopy Create free account
hub / github.com/EasyRPG/Player / RemoveMapping

Method RemoveMapping

src/window_input_settings.cpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool 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
61void Window_InputSettings::ResetMapping() {
62 Input::ResetDefaultMapping(button);

Callers 1

UpdateButtonRemoveMethod · 0.80

Calls 3

LowerBoundMethod · 0.80
endMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected