| 225 | } |
| 226 | |
| 227 | bool 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 | |
| 247 | bool SeizeInput::key_up(int key) |
| 248 | { |
nothing calls this directly
no outgoing calls
no test coverage detected