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

Method key_up

source/MaaWin32ControlUnit/Input/SeizeInput.cpp:247–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247bool SeizeInput::key_up(int key)
248{
249 if (hwnd_) {
250 ensure_foreground();
251 }
252 LogInfo << VAR(key) << VAR(hwnd_);
253
254 // OnScopeLeave([this]() { unblock_input(); });
255
256 INPUT inputs[1] = { };
257
258 inputs[0].type = INPUT_KEYBOARD;
259 inputs[0].ki.wVk = static_cast<WORD>(key);
260 inputs[0].ki.wScan = static_cast<WORD>(MapVirtualKeyW(static_cast<UINT>(key), MAPVK_VK_TO_VSC));
261 inputs[0].ki.dwFlags = KEYEVENTF_KEYUP;
262
263 SendInput(ARRAYSIZE(inputs), inputs, sizeof(INPUT));
264
265 return true;
266}
267
268bool SeizeInput::scroll(int dx, int dy)
269{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected