Skip to content

Commit

Permalink
Fixed OSX shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuked88 committed Jul 19, 2024
1 parent 7ae7da4 commit 4954cdf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
21 changes: 11 additions & 10 deletions app/js/sidebar_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();


}
if (event.altKey && event.key.toLowerCase() === "z") {
toggleSHSB()

// Per la combinazione Alt + Z
if (event.altKey && (event.key.toLowerCase() === "z" || event.keyCode === 90)) {
toggleSHSB();
}
if (event.altKey && event.key.toLowerCase() === "g") {
showSettings()
if (event.altKey && (event.key.toLowerCase() === "g" || event.keyCode === 71)) {
showSettings();
}

}


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 4954cdf

Please sign in to comment.