在Java中更改Windows键盘? [英] Change windows keyboard in java?

查看:149
本文介绍了在Java中更改Windows键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更改当前以编程方式使用的Windows键盘.

I'd like to change the windows keyboard that is currently being used programatically.

我正在写一种东方语言的字典程序,当用户单击另一个表列时,我希望它切换到另一个键盘.

I'm writing a dictionary program for an eastern language, and I want it to switch to another keyboard when the user clicks in a different table column.

我对此进行了调查,找到了使用Windows PowerShell和本机C ++代码的示例. PowerShell似乎无法正常工作,而且我对本机Windows API和C也不熟悉.对于在Java中实际完成此操作的任何帮助,将不胜感激.

I looked into this and found example using Windows PowerShell, and native C++ code. The PowerShell did not seem to work and I'm not familiar with the native Windows API and C. Any help on how to actually get this done in Java would be greatly appreciated.

推荐答案

下面是一篇博客文章,介绍了操作方法:

Here's a blog post that explains how to do it: change input method
In a nutshell:

yourMainJFrame.getInputContext().selectInputMethod(new Locale("fa", "IR")); 

这篇关于在Java中更改Windows键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆