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

Method click_key

source/MaaWin32ControlUnit/Manager/Win32ControlUnitMgr.cpp:348–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348bool Win32ControlUnitMgr::click_key(int key)
349{
350 if (managed_keys_.contains(key)) {
351 if (!background_keyboard_) {
352 LogError << "background_keyboard_ is null";
353 return false;
354 }
355 const bool key_down_ok = background_keyboard_->key_down(key);
356 const bool key_up_ok = background_keyboard_->key_up(key);
357 if (key_down_ok && !key_up_ok) {
358 LogError << "Managed key" << VAR(key) << "key_down succeeded but key_up failed; key may remain logically pressed";
359 }
360 return key_down_ok && key_up_ok;
361 }
362
363 if (!keyboard_) {
364 LogError << "keyboard_ is null";
365 return false;
366 }
367
368 return keyboard_->click_key(key);
369}
370
371bool Win32ControlUnitMgr::input_text(const std::string& text)
372{

Callers

nothing calls this directly

Calls 3

key_downMethod · 0.65
key_upMethod · 0.65
click_keyMethod · 0.65

Tested by

no test coverage detected