The default value of showDialogKeyCombo (?) only works in certain keyboard layouts
#4,849 创建于 2021年8月9日
描述
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
- Set your keyboard layout to Spanish (example)
- Focus the piano on the documentation.
- 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.