No, and you donβt even know if any particular keyboard layout is available (for example, any specific layout for the Thai language). There are four layouts for Thai on my computer. I never included any of them, but if I did this and use the layout, the likelihood that it will be different from what you are trying to make me use.
Custom character input can be tricky, but you can't fix it while trying to set the keyboard layout. If you can set the layout in JavaScript (I think you cannot), you can seriously disrupt functionality when the user is used to a completely different location.
In some cases, an on-screen keyboard may solve part of the problem. For example, if users only need to enter a word or two in Thai and everything else is in English, you can embed a virtual keyboard with a Thai character (and possibly hide it until the field for Thai input is focused).
Technically, you can set the lang
attribute for individual elements, for example, and that would be correct in principle, but in practice it hardly has any effect on anything now.
source share