Monday, May 20, 2024
81
rated 0 times [  83] [ 2]  / answers: 1 / hits: 34649  / 13 Years ago, tue, january 17, 2012, 12:00:00

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 layout as a string, e.g.de-ch, fr or en.


More From » keyboard-layout

 Answers
6

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.


[#87979] Sunday, January 15, 2012, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
magaly

Total Points: 524
Total Questions: 96
Total Answers: 89

Location: India
Member since Wed, Aug 26, 2020
4 Years ago
;