function pathKeyHandler(e) {
            let inputEl = document.querySelector("input.filePath");

            switch (e.code) {
                // Tab already handled
                case "ArrowUp":
                    e.preventDefault();
                    if (
                        e.target.classList.contains("directory") &&
                        e.target.previousElementSibling
                    ) {
                        e.target.previousElementSibling.focus();
                    } else if (e.target != inputEl) {
                        inputEl.focus();
                    }
                    break;
                case "ArrowDown":
                    e.preventDefault();
                    let paths = document.querySelector(".directory");

                    if (e.target == inputEl && paths != null) {
                        paths.focus();
                    } else if (
                        e.target.classList.contains("directory") &&
                        e.target.nextElementSibling
                    ) {
                        e.target.nextElementSibling.focus();
                    }
                    break;
                case "Enter":
                    e.preventDefault();
                    if (e.target.classList.contains("directory")) {
                        clickDirectoryHandler.apply(this, [e]);
                    }
                    break;
                case "Home":
                case "End":
                    // only handle when list has focus
                    if (e.target.classList.contains("directory")) {
                        e.preventDefault();
                        const dirs = e.target.parentElement.children;
                        dirs.item(e.code == "End" ? dirs.length - 1 : 0).focus();
                    }
                    break;
                case "PageUp":
                case "PageDown":
                    // only handle when list has focus
                    if (e.target.classList.contains("directory")) {
                        e.preventDefault();
                        const dirs = Array.from(e.target.parentElement.children);
                        const current = dirs.findIndex(
                            (element) => element.innerText == e.target.innerText
                        );
                        let next = 0;
                        if (e.code == "PageUp") {
                            next = Math.max(0, current - 10);
                        } else {
                            next = Math.min(dirs.length - 1, current + 10);
                        }
                        dirs[next].focus();
                    }
                    break;
                default:
                    break;
            }
        }
Event handler for onkeydown, browse and select listed directory
options for login file path.

@since 3.8.0

@param {object} e key event