From 4954cdf13d4ea725b3f920d0711ef1f758d14658 Mon Sep 17 00:00:00 2001 From: nuked88 Date: Fri, 19 Jul 2024 13:03:27 +0200 Subject: [PATCH] Fixed OSX shortcut --- README.md | 6 +++--- app/js/sidebar_node.js | 21 +++++++++++---------- pyproject.toml | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6504d7d..271c7b8 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,9 @@ The most important settings are stored in `custom_nodes/ComfyUI-N-Sidebar/settin # Keyboard Shortcuts -- `Alt+Z` to toggle show/hide sidebar -- `Alt+X` to focus on the search field -- `Alt+G` to open the settings +- `Alt+Z` or `Option+Z` to toggle show/hide sidebar +- `Alt+X` or `Option+X` to focus on the search field +- `Alt+G` or `Option+G` to open the settings # Features diff --git a/app/js/sidebar_node.js b/app/js/sidebar_node.js index aa5eed4..706840c 100644 --- a/app/js/sidebar_node.js +++ b/app/js/sidebar_node.js @@ -966,24 +966,25 @@ function toggleSHSB(force = undefined) { function handleKeyPress(event) { - if (event.altKey && event.key.toLowerCase() === "x") { - //toggle sidebar if it's closed + // Per la combinazione Alt + X + if (event.altKey && (event.key.toLowerCase() === "x" || event.keyCode === 88)) { + // Toggle sidebar if it's closed const side_bar = document.getElementById('content_sidebar_home'); if (side_bar.classList.contains('closed')) { toggleSHSB(); - } - //focus on searchInput + // Focus on searchInput searchInput.focus(); + } - + // Per la combinazione Alt + Z + if (event.altKey && (event.key.toLowerCase() === "z" || event.keyCode === 90)) { + toggleSHSB(); } - if (event.altKey && event.key.toLowerCase() === "z") { - toggleSHSB() - } - if (event.altKey && event.key.toLowerCase() === "g") { - showSettings() + if (event.altKey && (event.key.toLowerCase() === "g" || event.keyCode === 71)) { + showSettings(); } + } diff --git a/pyproject.toml b/pyproject.toml index fb4ca56..4a31d91 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui-n-sidebar" description = "A simple sidebar for ComfyUI." -version = "1.2.2" +version = "1.2.3" license = "LICENSE" [project.urls]