| 245 | } |
| 246 | |
| 247 | bool 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 | |
| 268 | bool SeizeInput::scroll(int dx, int dy) |
| 269 | { |
nothing calls this directly
no outgoing calls
no test coverage detected