diff --git a/src/main.js b/src/main.js index 5bf6f34d2a1d5aba8a9b812eef217ef3262f4683..70c3e693d0b8b91f3700a488f0f5c9cd0f00fc67 100644 --- a/src/main.js +++ b/src/main.js @@ -515,7 +515,11 @@ function addVoiceControls() { let index = commands.indexOf(command); // get index of command in array let path = availableCommands[index].path; // get corresponding path in availableCommands array navigateToPath(path); - } + } else if (command === "select" || command === "okay") navigateToSelected(); + else if (command === "open") moveDownNavigationLevel(); + else if (command === "emergency call") + navigateToPath("/menu/call/emergency"); + else if (command === "exit") navigateToPath("/"); }; recognition.onspeechend = function () { @@ -544,16 +548,8 @@ function addVoiceControls() { availableCommands.push(command); } - // add custom commands - availableCommands.push({ command: "exit", path: "/" }); - availableCommands.push({ - command: "emergency call", - path: "/menu/call/emergency", - }); - // form commands array for grammarlist commands = availableCommands.map((x) => x.command); - printLogMsg(`Voice > Commands: [${commands}]`); } } @@ -621,7 +617,7 @@ function addMotionControls() { let targetY = averageY; targetY = (targetY - referenceY) * -sensitivity; - // drawMotion(targetY); + drawMotion(targetY); focusClosestItem(targetY); } }