diff --git a/client/src/gl/viewport.ts b/client/src/gl/viewport.ts index 59fc214..8e625ab 100644 --- a/client/src/gl/viewport.ts +++ b/client/src/gl/viewport.ts @@ -127,10 +127,10 @@ export class Viewport { } private onkeydown(e: KeyboardEvent) { - if (e.key === 'ArrowLeft') this.pos.x -= 1 - else if (e.key === 'ArrowRight') this.pos.x += 1 - else if (e.key === 'ArrowUp') this.pos.y -= 1 - else if (e.key === 'ArrowDown') this.pos.y += 1 + if (e.key === 'ArrowLeft' || e.key === 'a') this.pos.x -= 1 + else if (e.key === 'ArrowRight' || e.key === 'd') this.pos.x += 1 + else if (e.key === 'ArrowUp' || e.key === 'w') this.pos.y -= 1 + else if (e.key === 'ArrowDown' || e.key === 's') this.pos.y += 1 } // ------------ mobile events -------------------------------- diff --git a/client/src/ui/lib/editBrush.svelte b/client/src/ui/lib/editBrush.svelte index f49d2a7..f0a4ad3 100644 --- a/client/src/ui/lib/editBrush.svelte +++ b/client/src/ui/lib/editBrush.svelte @@ -252,10 +252,10 @@ function onKeyPress(e: KeyboardEvent) { if (e.ctrlKey || e.altKey) return - if (['r', 'v', 'h', 'n', 'm'].includes(e.key.toLowerCase())) e.preventDefault() + if (['r', 't', 'v', 'h', 'n', 'm'].includes(e.key.toLowerCase())) e.preventDefault() if (e.key === 'r') onRotateCW() - else if (e.key === 'R') onRotateCCW() + else if (e.key === 'R' || e.key === 't') onRotateCCW() else if (e.key === 'v' || e.key === 'm') onFlipV() else if (e.key === 'h' || e.key === 'n') onFlipH() } diff --git a/client/src/ui/lib/editor.svelte b/client/src/ui/lib/editor.svelte index 53edff5..2369c57 100644 --- a/client/src/ui/lib/editor.svelte +++ b/client/src/ui/lib/editor.svelte @@ -160,10 +160,6 @@ } } - function onToggleAnim() { - $anim = !$anim - } - function onUndo() { if (!$server.undo()) { console.warn('cannot undo') @@ -182,13 +178,13 @@ Editor.fire('keydown', e) - if (e.ctrlKey && ['s', ' ', 'z', 'y'].includes(e.key)) { + if (e.ctrlKey && ['s', ' ', 'z', 'y', 'm'].includes(e.key)) { e.preventDefault() if (e.key === 's') { Actions.saveMap() - } else if (e.key === ' ') { - onToggleAnim() + } else if (e.key === ' ' || e.key === 'm') { + $anim = !$anim } else if (e.key === 'z') { onUndo() } else if (e.key === 'y') { diff --git a/client/src/ui/lib/mapView.svelte b/client/src/ui/lib/mapView.svelte index 0e78027..34183c7 100644 --- a/client/src/ui/lib/mapView.svelte +++ b/client/src/ui/lib/mapView.svelte @@ -85,7 +85,7 @@ } -