keyboard
Interact with the keyboard device
Press
keyboard.pressKey(string: Key);The keyboard.pressKey function allows you to simulate key presses by inputting the key value as a string. For instance, you can press "W", "SPACE", or "D" to mimic keyboard actions as shown in the examples. This functionality eliminates the need for System.Keys, streamlining the process of triggering keyboard events.
keyboard.pressKey("W");
keyboard.pressKey("SPACE");
keyboard.pressKey("D");Is key down?
keyboard.isKeyDown(Keys: key);Checks if a specific key from the System.Windows.Forms.Keys enum is currently pressed.
Example:
if (keyboard.isKeyDown(keys.Space))
{
client.print("space bar is pressed");
}Last updated
Was this helpful?