Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js simulate keyboard input

element.dispatchEvent(new KeyboardEvent("keydown", {
    key: "e",
    keyCode: 69,        // example values.
    code: "KeyE",       // put everything you need in this object.
    which: 69,
    shiftKey: false,    // you don't need to include values
    ctrlKey: false,     // if you aren't going to use them.
    metaKey: false      // these are here for example's sake.
}));
 
PREVIOUS NEXT
Tagged: #js #simulate #keyboard #input
ADD COMMENT
Topic
Name
1+9 =