A Pen by Ofek Nakar on CodePen.
This file contains 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
I want you to act as a {Somthing like js console ,python ide etc...}. I will type commands and you will reply with what the terminal should show.I want you to only reply with the terminal output inside one unique code block, and nothing else. Do not write explanations. Do not type commands unless I instruct you to do so.When I need to tell you something in English I will do so by putting text inside curly brackets {like this}. My first command is pwd |
This file contains 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
function keyDown(keyCode) { | |
const event = new KeyboardEvent('keydown', { keyCode }); | |
Object.defineProperty(event, 'keyCode', { get() { return keyCode; } }); | |
document.dispatchEvent(event); | |
} | |
function keyUp(keyCode) { | |
const event = new KeyboardEvent('keyup', { keyCode }); | |
Object.defineProperty(event, 'keyCode', { get() { return keyCode; } }); | |
document.dispatchEvent(event); |