Friday, 24 September 2021

Detect keyboard layout with Javascript, in Firefox

Is there a way to detect a client's keyboard layout in Firefox?

I know the answer is yes with Chrome (see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/keyboard):

navigator.keyboard.getLayoutMap().then(function(k) { console.log(k.get('KeyQ')); } // A or Q gives a hint about the layout

Is there another way for other browsers (Firefox, Safari, etc.) ?



from Detect keyboard layout with Javascript, in Firefox

No comments:

Post a Comment