Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to detect what the input language setting is currently?

I basically want to know what the system's input language is currently on (for users who have multiple language input methods set up). This will determine whether if the text-direction of a <textarea> should be rtl or not.

Please keep in mind that this setting can change after the page is loaded.

Is there a simple way of doing it in JavaScript/jQuery?

like image 833
Tarek Fadel Avatar asked Feb 21 '23 07:02

Tarek Fadel


1 Answers

There is no way for the browser to tell what the current keyboard layout (input language) is. As @kirilloid mentioned, one possible workaround is to check the keycode on keyup and determine the language from that.

like image 72
Tarek Fadel Avatar answered Apr 08 '23 11:04

Tarek Fadel