github / github/markdown-toolbar-element

Hotkeys don't work on Windows with non en-us keyboard layout

未关闭
#15 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
JavaScript
星标
411
派生
60
平均合并
2 天 22 小时
30 天内合并 PR
6

描述

Current way of matching hotkey with `event.key` property leads to broken hotkeys on Windows (Chrome, Vivaldi at least) as, for example with ru-RU locale on keybord hitting cmd+b will send event with `key` property set to cyrillic "и" and not "b".

First it was found in https://github.com/umputun/remark/issues/404

Images provided by @Andrew-Shtein prove difference in `key` prop
![](https://user-images.githubusercontent.com/12440746/62982919-fe164e00-be70-11e9-8ae5-44a37d90ef3e.png)
![](https://user-images.githubusercontent.com/12440746/62982927-040c2f00-be71-11e9-8ab1-2e76abb9c45d.png)

Issue located here:
https://github.com/github/markdown-toolbar-element/blob/dd0ffba8d9ad9d64471d3be41b3b7e1b77aa3545/index.js#L228-L236

贡献指南

打开贡献指南

调研方向

从 index.js 的第 228-236 行开始,这里会根据键盘事件匹配热键,并在使用非 en-US 布局(例如 ru-RU)的 Chrome 或 Vivaldi 中重现该问题。跟踪当前的匹配行为,并验证每个已记录的热键无论键盘布局如何都会触发相同的命令。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。