Skip to content
Snippets Groups Projects
Commit 041c67c2 authored by jahugg's avatar jahugg
Browse files

fixed button up, down issue

parent e608ce71
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,8 @@ const config = {
controls: {
mouse: true,
button: true,
voice: true,
motion: true,
voice: false,
motion: false,
},
};
......@@ -105,7 +105,7 @@ const navigation = {
let logId = 0;
// Create WebSocket connection.
const socket = new WebSocket(`wss://192.168.27.52:443`);
const socket = new WebSocket(`wss://192.168.151.52:443`);
// init application
function init() {
......@@ -325,8 +325,11 @@ function focusNextNavigationItem() {
if (!currentItem) focusNavigationItem(1);
else if (currentItem.nextSibling) {
let nextItem = currentItem.nextSibling;
delete currentItem.dataset.selected;
currentItem.nextSibling.dataset.selected = "";
nextItem.dataset.selected = "";
let index = Array.from(currentItem.parentNode.children).indexOf(nextItem);
focusNavigationItem(index + 1);
} else focusNavigationItem(1);
}
......@@ -339,8 +342,11 @@ function focusPreviousNavigationItem() {
if (!currentItem) focusNavigationItem(1);
else if (currentItem.previousSibling) {
let prevItem = currentItem.previousSibling;
delete currentItem.dataset.selected;
currentItem.previousSibling.dataset.selected = "";
prevItem.dataset.selected = "";
let index = Array.from(currentItem.parentNode.children).indexOf(prevItem);
focusNavigationItem(index + 1);
} else {
let childCount = document.querySelector("#navigation > ul").children.length;
focusNavigationItem(childCount);
......@@ -486,7 +492,8 @@ function addButtonControls() {
if (event.code === "Tab" || event.code === "ArrowDown")
focusNextNavigationItem();
else if (event.code === "ArrowUp") focusPreviousNavigationItem();
else if (event.code === "Enter" || event.code === "ShiftRight") navigateToSelected();
else if (event.code === "Enter" || event.code === "ShiftRight")
navigateToSelected();
else if (event.code === "ArrowRight") moveDownNavigationLevel();
else if (event.code === "ArrowLeft" || event.code === "Escape")
moveUpNavigationLevel();
......@@ -612,8 +619,8 @@ function addMotionControls() {
let screenCenter = new Point(window.innerWidth / 2, window.innerHeight / 2);
let idleTimeout;
let idleDelay = 4000; //idle time before reseting reference point
let autoSelect = true; // selecting items with time delay
let drawMotionFlag = true; // draw motion values for debugging
let autoSelect = false; // selecting items with time delay
let drawMotionFlag = false; // draw motion values for debugging
// motion buffer stuff
let motionBuffer = []; // motion value buffer
......
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment