Comfy-Org / Comfy-Org/ComfyUI_frontend

Keyboard Shortcuts don't work on non-english (non-latin) keyboard layouts

Open
#5,252 5 comments 0 reactions 0 assignees View on GitHub
area:hotkeys Potential Bug
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

### Prerequisites

- [x] I am running the latest version of ComfyUI
- [x] I have searched existing issues to make sure this isn't a duplicate
- [x] I have tested with all custom nodes disabled ([see how](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled))

### What happened?

Keyboard Shortcuts don't work on non-english (non-latin) keyboard layouts. `r` - no reaction, `ctrl+s` - html saving prompt. Etc

It's needed to use `event.code === "KeyR"` insted of `event.key === "r"`. I tested it on [this playground](https://developer.mozilla.org/en-US/play?uuid=a529d57d-574a-4d7a-99ad-39d4423e9b8e&state=VVLBjpswEP2VkdsqRCLsVlUPZZNI7WqlrdpDD3vksAYPwY2xkT2QRCn%2F3jHQjXpj5r15b%2FyGq2ioNSIX225fWIBfHkOAI14COAvUYPwunfQKyEFAhFMjaQJ%2BLMDTgJZW0xBIq6ByCmGQpscQFaVHqJ0HlFXDmpgVdnsXzbZKD6DVrhCup66nQgDJUluFZ%2B7dF2K%2FvWMKM0UqqhB4yXczE65RuHaWNrVstbnk8NVraVJ4RjMg6UqmEKQNm4Be1w%2BRXTqv0OfwsTtDcEYrKI2sjhN20oqaHL58%2FjCVrfQHbXOQPTlujIVdfPPaVX3YDDro0uC8BSNGW8zh05uwcuqAvuQA5mle%2F3fc%2FsRvc6dMqjmynzoQWvRJlCkEx8eoLUQa6wQjZQ27%2FWwDHKsNBB3sWL%2FqW0azyqMkfDIYq6QQXSHWDzO7ywjP9MgRMcQzr%2F9dK4%2FH2q3eXyeXjItxBX%2Bmy926sRpXr4vgm%2BkBaXH8dvmuktv11pnsOrTqsdFGJd2%2FTZZXh8o7Y15ccp%2FetEqnLgvyjPrQ0Dw0ThGQ75E%2FYosT5D%2BuRQ5RSX8U418%3D&srcPrefix=%2Fen-US%2Fdocs%2FWeb%2FAPI%2FKeyboardEvent%2Fcode%2F)

Image

### Steps to Reproduce

1. switch layout to non-latin
2. try shortcuts
3.

### How is this affecting you?

Feature doesn't work as expected

### ComfyUI Frontend Version

1.25.10

### Browser

Chrome/Chromium

### Console Errors

```javascript

```

### Logs

```shell

```

### Additional Context

I tried both Firefox and Chromium but the issue template allows to select only 1 choice

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-5252-Keyboard-Shortcuts-don-t-work-on-non-english-non-latin-keyboard-layouts-25e6d73d3650816dbea7e7433e2bea35) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.