MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / handle_click_key

Method handle_click_key

source/MaaFramework/Controller/ControllerAgent.cpp:727–750  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725}
726
727bool ControllerAgent::handle_click_key(const ClickKeyParam& param)
728{
729 if (!control_unit_) {
730 LogError << "control_unit_ is nullptr";
731 return false;
732 }
733
734 bool ret = !param.keycode.empty();
735
736 bool use_key_down_up = control_unit_->get_features() & MaaControllerFeature_UseKeyboardDownAndUpInsteadOfClick;
737
738 for (const auto& keycode : param.keycode) {
739 if (use_key_down_up) {
740 ret &= control_unit_->key_down(keycode);
741 std::this_thread::sleep_for(std::chrono::milliseconds(50));
742 ret &= control_unit_->key_up(keycode);
743 }
744 else {
745 ret &= control_unit_->click_key(keycode);
746 }
747 }
748
749 return ret;
750}
751
752bool ControllerAgent::handle_long_press_key(const LongPressKeyParam& param)
753{

Callers

nothing calls this directly

Calls 5

get_featuresMethod · 0.65
key_downMethod · 0.65
key_upMethod · 0.65
click_keyMethod · 0.65
emptyMethod · 0.45

Tested by

no test coverage detected