From d514957d9a0c0019d0cf5a8735ea4036727b9c1e Mon Sep 17 00:00:00 2001 From: Oliver Blanthorn Date: Mon, 15 Feb 2021 13:34:45 +0100 Subject: [PATCH] WIP: add keyfake command --- src/excmds.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/excmds.ts b/src/excmds.ts index 38bfea6a..8af9b4d3 100644 --- a/src/excmds.ts +++ b/src/excmds.ts @@ -5098,6 +5098,15 @@ export async function keyfeed(mapstr: string) { } } +//#content +export async function keyfake(mapstr: string) { + const keyseq = mapstrToKeyseq(mapstr) + for (const k of keyseq) { + window.dispatchEvent(new KeyboardEvent("keydown", k)) + await sleep(10) + } +} + /** Open a welcome page on first install. * * @hidden