I have a textField that, according to certain conditions, should accept only text in Hebrew, according to other conditions only Bengali, or only Greek etc.
For instance, to detect if the user is typing using the Bengali keyboard, at present I have this snipped in the keydown event of the textField, where kBanglaGlyphs is a constant string containing the Bengali alphabet; to detect other languages I have other constants containing the alphabet of other languages.
if key = instr(kBanglaGlyphs, key) > 0 then
if key = instr(kHebrewGlyphs, key) > 0 then
//etc. for each language
Does anybody have code for Mac and win32 that tells which keyboard is in use at a particular time?
As far as I know, MacOSlibrary doesnt seem to have something of this kind; but I may have overlooked it.
Of course, preferredLanguage is not the solution for what I need.
No plugins, please.