mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-04 07:00:23 +00:00
Fix keybinds invalidated by capslock state (#1776)
* [Refactor] Simplify keybinds code * [Refactor] Type safety * Fix capslock inverts undo/redo shortcuts * [Refactor] Type safety * Fix capslock state changes keybinds * Deprecate keybind deserialize * Remove keybind deserialize
This commit is contained in:
@@ -163,11 +163,13 @@ export class ChangeTracker {
|
||||
}
|
||||
|
||||
async undoRedo(e: KeyboardEvent) {
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
if (e.key === 'y' || e.key == 'Z') {
|
||||
if ((e.ctrlKey || e.metaKey) && !e.altKey) {
|
||||
const key = e.key.toUpperCase()
|
||||
// Redo: Ctrl + Y, or Ctrl + Shift + Z
|
||||
if ((key === 'Y' && !e.shiftKey) || (key == 'Z' && e.shiftKey)) {
|
||||
await this.redo()
|
||||
return true
|
||||
} else if (e.key === 'z') {
|
||||
} else if (key === 'Z' && !e.shiftKey) {
|
||||
await this.undo()
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user