Skip to content

Commit 4e37619

Browse files
committed
Restored key events
1 parent 23325a4 commit 4e37619

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/js/sand_table_pattern_maker.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,20 +808,17 @@ function optimizePath(path, min_distance)
808808
/**
809809
* Process key presses
810810
*/
811-
function keyTyped() {
812-
if (key === 'c') {
811+
window.addEventListener('keydown', (event) => {
812+
if (event.key === 'c') {
813813
coordinate_overlay = !coordinate_overlay;
814-
} else if (key === 'd') {
815-
814+
} else if (event.key === 'd') {
816815
var selected_pattern = pattern_select.value();
817816
let path = Patterns[selected_pattern].draw();
818-
819817
imagePath(path);
820-
821-
} else if (key === 'o') {
818+
} else if (event.key === 'o') {
822819
pattern_config_overlay = !pattern_config_overlay;
823820
}
824-
}
821+
});
825822

826823
/**
827824
* Convert a Path to an image

0 commit comments

Comments
 (0)