MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / input_keybind_callback

Method input_keybind_callback

src/MainProgram.cpp:417–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415}
416
417bool MainProgram::input_keybind_callback(const Vector2ui32& newKey) {
418 if(keybindWaiting.has_value()) {
419 unsigned v = keybindWaiting.value();
420
421 input.keyAssignments.erase(newKey);
422 auto f = std::find_if(input.keyAssignments.begin(), input.keyAssignments.end(), [&](auto& p) {
423 return p.second == v;
424 });
425 if(f != input.keyAssignments.end())
426 input.keyAssignments.erase(f);
427 input.keyAssignments.emplace(newKey, v);
428 keybindWaiting = std::nullopt;
429 g.gui.set_to_layout();
430 post_callback();
431 return true;
432 }
433 return false;
434}
435
436void MainProgram::input_drop_file_callback(const InputManager::DropCallbackArgs& drop) {
437 screen->input_drop_file_callback(drop);

Callers 1

Calls 6

find_ifFunction · 0.85
set_to_layoutMethod · 0.80
valueMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected