feat(nds): improve key input system
This commit is contained in:
@@ -131,7 +131,7 @@ onClick((x, y) => {
|
||||
}
|
||||
});
|
||||
|
||||
useKeyDown((key) => {
|
||||
useKeyDown(({ key }) => {
|
||||
if (isAnimating.value) return;
|
||||
if (key === "NDS_X") {
|
||||
handleVisitAll();
|
||||
|
||||
@@ -538,7 +538,7 @@ const slide = (rowDir: number, colDir: number) => {
|
||||
}
|
||||
};
|
||||
|
||||
useKeyDown((key) => {
|
||||
useKeyDown(({ key }) => {
|
||||
if (isAnimating.value) return;
|
||||
switch (key) {
|
||||
// TODO: remove this, testing only
|
||||
|
||||
@@ -139,7 +139,7 @@ const select = (col: number, row: number) => {
|
||||
app.setColor(col, row);
|
||||
};
|
||||
|
||||
useKeyDown((key) => {
|
||||
useKeyDown(({ key }) => {
|
||||
if (isAnimating.value) return;
|
||||
|
||||
switch (key) {
|
||||
|
||||
@@ -302,7 +302,7 @@ onRender((ctx) => {
|
||||
);
|
||||
}, 110);
|
||||
|
||||
useKeyDown((key) => {
|
||||
useKeyDown(({ key }) => {
|
||||
if (state.value !== "alive") return;
|
||||
|
||||
const newDirection = direction.clone();
|
||||
|
||||
Reference in New Issue
Block a user