-
-
Save alexunderboots/0277bfd50776169786a100c32e7c11e3 to your computer and use it in GitHub Desktop.
Auto type in noVNC (Proxmox)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const text = prompt("Enter text to type:"); | |
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
const input = document.getElementById("noVNC_keyboardinput"); | |
const keydown = (key) => input.dispatchEvent(new KeyboardEvent("keydown", { key })); | |
for (let i = 0; i < text.length; i++) { keydown(text[i]); await sleep(50); } | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment