user2212726
user2212726

Reputation: 1285

How to check current keyboard language in java

is there a way in java to check what is the keyboard language in the current program? example:

Chrome : english

Eclipse: english

Skype: spanish

Chrome: english

(i can get the current program by jna - external library)

thanks very much !

Upvotes: 4

Views: 3256

Answers (1)

Sudheej
Sudheej

Reputation: 2019

Try this:

import java.awt.im.*;  

public class _Test  
{  
    public static void main(String[] args)  
    {  
        InputContext context = InputContext.getInstance();  
        System.out.println(context.getLocale().toString());  
    }  
} 

Upvotes: 5

Related Questions