X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/13c97b9931434fe043c29c296792121cdf91e807..75a42da4667eceebea699c52d85fa4b7c3e6a0bc:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index 1961dd9..8db2865 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -7,7 +7,7 @@ const Model = { }, addTask: function (description: string) { - document.body.appendChild(this.createTask(description)); + document.body.appendChild(this.createTask(description)).focus(); }, moveCursor: function (offset: number) { @@ -26,6 +26,10 @@ function handleKey(event: any) { if (event.target.tagName !== "INPUT") { if (event.key == "j") Model.moveCursor(1); if (event.key == "k") Model.moveCursor(-1); + if (event.key == "c") { + document.getElementById("taskName")!.focus(); + event.preventDefault(); + } } }