set InputMethod if LanguageManager is set

Request new features and improvements you want to see in WebLaF.
I will answer any request so don't hesitate and post it!

set InputMethod if LanguageManager is set

Postby Abu Abdullah » Sat Oct 12, 2013 12:45 pm

Hi,

how about setting the keyboard input to the same language of LanguageManager e.g.

LanguageManager.setLanguage(LanguageManager.ARABIC);

will set the keyboard input to Arabic.

The implementation depends on the OS e.g. in Windows we need to set the language and country (assuming the user add the language at the OS level), otherwise it will not work. i.e. for Arabic:

this.getInputContext().selectInputMethod(new Locale("ar", "DZ"));
this.getInputContext().selectInputMethod(new Locale("ar", "IQ"));
this.getInputContext().selectInputMethod(new Locale("ar", "JO"));
this.getInputContext().selectInputMethod(new Locale("ar", "LB"));
this.getInputContext().selectInputMethod(new Locale("ar", "LY"));
this.getInputContext().selectInputMethod(new Locale("ar", "MA"));
this.getInputContext().selectInputMethod(new Locale("ar", "OM"));
this.getInputContext().selectInputMethod(new Locale("ar", "SD"));
this.getInputContext().selectInputMethod(new Locale("ar", "SY"));
this.getInputContext().selectInputMethod(new Locale("ar", "TN"));
this.getInputContext().selectInputMethod(new Locale("ar", "YE"));
this.getInputContext().selectInputMethod(new Locale("ar", "QA"));
this.getInputContext().selectInputMethod(new Locale("ar", "KW"));
this.getInputContext().selectInputMethod(new Locale("ar", "BH"));
this.getInputContext().selectInputMethod(new Locale("ar", "EG"));
this.getInputContext().selectInputMethod(new Locale("ar", "SA"));
this.getInputContext().selectInputMethod(new Locale("ar", "AE"));

(assuming the user set one of these at the OS level). the same goes for others e.g. English.US/English.UK/English.Canada ........

the above did not work in Linux so it is OS-dependent feature.
Abu Abdullah
 
Posts: 41
Joined: Tue Apr 17, 2012 12:11 pm

Re: set InputMethod if LanguageManager is set

Postby mgarin » Mon Oct 14, 2013 4:08 pm

It might be a good idea, but I am not sure about it - never tried to modify keyboard input. Plus i am trying to avoid OS-dependant solutions as much as i can because they always cause more harm than good.

I will try to search for some better solutions later and maybe i will find something :)
User avatar
mgarin
Site Admin
 
Posts: 223
Joined: Mon Apr 16, 2012 1:01 pm
Location: Russia, Saint-Petersburg


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron