palantir/blueprint

The default value of showDialogKeyCombo (?) only works in certain keyboard layouts

Open

#4,849 创建于 2021年8月9日

在 GitHub 查看
 (9 评论) (1 反应) (0 负责人)TypeScript (20,263 star) (2,167 fork)batch import
Domain: accessibilityDomain: i18nP2Package: coreType: bughelp wanted

描述

Environment

  • Package version(s): @blueprintjs/core 3.47.0
  • Operating System: Ubuntu 21.04
  • Browser name and version: Electron 13.1.8 (reproduces on Chrome 92.0.4515.107 as well)

Code Sandbox

Link to a minimal repro: https://blueprintjs.com/docs/#core/hooks/use-hotkeys (yes, that's your own documentation, it also reproduces there)

Steps to reproduce

  1. Set your keyboard layout to Spanish (example)
  2. Focus the piano on the documentation.
  3. Try to open the key combo dialog by typing ?.

Actual behavior

Nothing. The ? doesn't get registered. It also doesn't work as a regular "combo" in HotkeyConfig.

Note that Electron and Chrome both catch that key if you use document.body.onkeydown. Also, on gmail, the ? hotkey works well with my layout.

Expected behavior

The key combo dialog opens.

Possible solution

If I set my keyboard layout to English/US, then ? works, both in showDialogKeyCombo as well as HotkeyConfig. Of course this is not a great workaround... I can't just ask all my users to change their keyboard layout to use my app. I don't know the blueprint codebase well enough to propose other alternatives. Happy to help with debugging if you point me in the right direction.

贡献者指南