send key press
| 514 | |
| 515 | // send key press |
| 516 | int pressKey(KeyCode vkKey, bool pressed) |
| 517 | { |
| 518 | if (vkKey == 0) |
| 519 | return 0; |
| 520 | if (vkKey.code <= V_WHEEL_DOWN) |
| 521 | { |
| 522 | // Highest mouse ID |
| 523 | return pressMouse(vkKey.code, pressed); |
| 524 | } |
| 525 | |
| 526 | if (pressed) |
| 527 | { |
| 528 | keyboard.press_key(vkKey.code); |
| 529 | } |
| 530 | else |
| 531 | { |
| 532 | keyboard.release_key(vkKey.code); |
| 533 | } |
| 534 | |
| 535 | return 0; |
| 536 | } |
| 537 | |
| 538 | float accumulatedX = 0; |
| 539 | float accumulatedY = 0; |
no test coverage detected