detect keyboard layout with javascript

后端 未结 5 736
盖世英雄少女心
盖世英雄少女心 2020-11-29 08:47

Is there any way to detect the current keyboard layout using JavaScript? I found this, but it only detects if the visitor is on the english layout. I need to know the exact

5条回答
  •  星月不相逢
    2020-11-29 09:05

    Keyboard layouts do not have standardized identifiers. They have names assigned to them by the layout creator. They may have a language association as one defined property.

    The Keyboard layouts should not be confused with language or locale identifiers. In particular there is no single “English layout” but dozens of layouts that may be used for English.

    I don’t think systems normally make their current layout settings readable via JavaScript.

    So whatever problem you are trying solve by detecting the keyboard layout, a different approach is needed.

提交回复
热议问题