将虚拟键盘更改为AZERTY [英] Change virtual keyboard to AZERTY

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

问题描述

我有一个Javafx应用程序,该应用程序应该在Windows平板电脑上以全屏模式运行.

I have a javafx application that is supposed to run in fullscreen mode on a Windows tablet.

我的问题是,当键盘出现时,它在QWERTY中,而平板电脑在AZERTY中.

My problem is, when the keyboard appears, it's in QWERTY whereas my tablet is in AZERTY.

问题是:是否可以使用系统虚拟键盘或将javafx虚拟键盘切换为AZERTY?

So the question is : Is there a way to use the system virtual keyboard or to switch the javafx virtual keyboard to AZERTY?

推荐答案

我发现您在尝试完成同一件事时提出了疑问. 我花了一天时间尝试使javafx显示一个AZERTY键盘,然后找到了解决方案!

I found you question while trying to accopllish the same thing. I spent a day trying to make javafx display an AZERTY keyboard and i found a solution!

让我清楚一点:javafx根本没有办法使用azerty键盘,因此您需要稍微修改一下.

Well let me be clear : javafx gave no way at all to have an azerty keyboard so you have to hack a little.

以下解决方案不是一个完美的解决方案,每次更新javafx时都必须重复该解决方案,但是它可以让您在古怪和无礼的情况下极大地自定义键盘.

The solution bellow is not a perfect one and you'll have to repeat it each time you update javafx, but it will allow you to extrem customize the keyboard far beyong querty and azerty.

解决方案1(肮脏但有效)

您将需要编辑JDK随附的javafx文件中的文件

You will need to edit a file in javafx file shipped with the JDK

STEPS:

  1. 转到JDK(在Mac中:/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home)

  1. GO to the JDK (in Mac : /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home)

进入jre/lib/ext并将名为jfxrt.jar的javafx jar复制到桌面上的文件夹中.

Go inside jre/lib/ext and copy javafx jar called jfxrt.jar to a folder on your desktop.

如果没有EMACS,请安装它,然后使用此软件打开复制的jar文件

Install EMACS if you don't have it and open the copied jar file with this software

浏览文件列表以搜索com/sun/javafx/scene/control/skin/TextBoard.txt 该列表是按A-Z排序的,因此请使用它(有6000多个文件).

Browse files list searching for com/sun/javafx/scene/control/skin/TextBoard.txt the list is sorted from A-Z so use it (there is more than 6000 files).

打开它,就在这里.将字符更改为使您满意的任何顺序.我加入了禁毒令.

Open it and HERE you are. Change characters to whatever order makes you happy. I joined the azerty order.

保存jfxrt.jar并将其复制回原来的位置.完成.

Save and copy back the jfxrt.jar to where it was. Done.

注意:请勿尝试解压缩jar并将其重新压缩,因为jdk会保留文件的索引列表,所以它将不起作用.

Note: don't try to extract the jar and rezip it, it won't work as jdk keeps an index list of files.

结果:有效的Javafx虚拟键盘

解决方案2(干净,但我没有完成)

当我深入研究javafx类时,发现负责加载布局键盘的TextBoard.txt文件的类是FXKVSkin 此类旨在接收除lonly qwerty默认键盘之外的其他类型的键盘. 您所要做的就是在您的代码中添加它:

Whene i digged into javafx classes i found out that the class responsible for loading the TextBoard.txt file that lays out the keyboard is FXKVSkin This class is meant to receive other type of keyboards than the lonly qwerty default one. All you have to do is add this in your code :

textFieldThatYouUse.getProperties().put(FXVK.VK_TYPE_PROP_KEY, "mykeyboard");

textFieldThatYouUse.getProperties().put(FXVK.VK_TYPE_PROP_KEY, "mykeyboard");

mykeyboard是您创建的文件,例如TextBoard.txt,称为MykeyboardBoard.txt(大写字母很重要).

Where mykeyboard is a file you created like TextBoard.txt called MykeyboardBoard.txt (capitals letters are important).

FXKVSkin现在将查找名为MykeyboardBoard.txt的文件,这就是我的冒险之旅的终点. 您将需要让FXKVSkin找到您的文件,我在运行时解决方案

FXKVSkin will look now for a file called MykeyboardBoard.txt, and here's where my adventure ended. You will need to make FXKVSkin find your file, i tried by adding a file to the classpath at runtime solutions Here but it didn't work.

如果任何人都可以解决此问题,请添加它作为答案,这将是一个不太麻烦的解决方案.

If anyone can solve this problem, please add it as an answer, it would be a less dirty solution.

希望解决方案将对一些非英语使用者有所帮助! :p

Hope the solutions will help some non english speakers! :p

这篇关于将虚拟键盘更改为AZERTY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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