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

Method key_down

source/MaaWin32ControlUnit/Input/SeizeInput.cpp:227–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool SeizeInput::key_down(int key)
228{
229 if (hwnd_) {
230 ensure_foreground();
231 }
232 LogInfo << VAR(key) << VAR(hwnd_);
233
234 // check_and_block_input();
235
236 INPUT inputs[1] = { };
237
238 inputs[0].type = INPUT_KEYBOARD;
239 inputs[0].ki.wVk = static_cast<WORD>(key);
240 inputs[0].ki.wScan = static_cast<WORD>(MapVirtualKeyW(static_cast<UINT>(key), MAPVK_VK_TO_VSC));
241
242 SendInput(ARRAYSIZE(inputs), inputs, sizeof(INPUT));
243
244 return true;
245}
246
247bool SeizeInput::key_up(int key)
248{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected