-
Notifications
You must be signed in to change notification settings - Fork 2
Keyboard Functions
Oğuzhan edited this page Sep 28, 2023
·
1 revision
To easily use the keyboard:
const {keyboard} = jsautogui // jsautogui has to be defined
// or
import {keyboard} from "jsautogui" // modulejs
// or
const {keyboard} = require("jsautogui") // commonjs
Presses a button on the keyboard.
keyboard.press("a")
keyboard.press("a", "shift")
Presses a button down on the keyboard and doesn't release back.
keyboard.down("a")
keyboard.down("a", "shift")
Releases a buttpn on the keyboard.
keyboard.up("a")
keyboard.up("a", "shift")
Writes text for the keyboard.
keyboard.write("Hello, world!")
keyboard.write("Hello, world!", "I am alive!")
Presses as a hotkey. First presses down all keys and releases them back up after pressing them all down.
keyboard.hotkey("control", "c")
keyboard.hotkey("control", "v") // you are now officially a programmer