From: Scott Worley Date: Thu, 27 Jan 2022 07:00:48 +0000 (-0800) Subject: Leader key "v" for selecting views X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/854992ec001df4ca15d25e24dbc558353032e3b7 Leader key "v" for selecting views --- diff --git a/vopamoi.ts b/vopamoi.ts index 80e8ff9..4280ffc 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -312,6 +312,7 @@ const BrowserUI = { enum InputState { Command, + View, } var inputState = InputState.Command; @@ -337,6 +338,9 @@ function handleKey(event: any) { if (event.key == "X") return BrowserUI.setState("deleted"); if (event.key == "u") return BrowserUI.undo(); if (event.key == "e") return BrowserUI.beginEdit(event); + if (event.key == "v") return (inputState = InputState.View); + } else if (inputState === InputState.View) { + return (inputState = InputState.Command); } } }