Change virtual keyboard to AZERTY - javafx

I have a javafx application that is supposed to run in fullscreen mode on a Windows tablet.
My problem is, when the keyboard appears, it's in QWERTY whereas my tablet is in AZERTY.
So the question is : Is there a way to use the system virtual keyboard or to switch the javafx virtual keyboard to 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!
Well let me be clear : javafx gave no way at all to have an azerty keyboard so you have to hack a little.
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.
SOLUTION 1 (dirty but works )
You will need to edit a file in javafx file shipped with the JDK
STEPS :
GO to the JDK (in Mac : /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home)
Go inside jre/lib/ext and copy javafx jar called jfxrt.jar to a folder on your desktop.
Install EMACS if you don't have it and open the copied jar file with this software
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.
Save and copy back the jfxrt.jar to where it was. Done.
Note: don't try to extract the jar and rezip it, it won't work as jdk keeps an index list of files.
Result:azerty javafx virtual keyboard in action
SOLUTION 2 (Clean but i didn't finish it)
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");
Where mykeyboard is a file you created like TextBoard.txt called MykeyboardBoard.txt (capitals letters are important).
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.
Hope the solutions will help some non english speakers! :p

The definition of the layout is contained in jfxrt.jar (part of the Java install). It is described by TextBoard.txt. It is possible to browse in the jfxrt.jar with 7zip or similar programs. TextBoard.txt is in com/sun/javafx/scene/control/skin/
This file is loaded com/sun/javafx/scene/control/skin/FXVKSkin.java is responsible for loading the TextBoard.txt file. Browse the javafx source (included via the jdk and contained in javafx-src.zip) to see how it is processed. Maybe this will give you enough information to load your own TextBoard.txt file.

Related

Eclipse WikiText: How to set css for preview?

Using Eclipse 2020-09 (i.e. v. 4.17) IDE for Java (on Linux, openSUSE Tumbleweed), with version 3.0.38 of Mylyn WikiText plugin installed, I had the following difficulty: Although pretty much all editor/ui fonts were fine, the HTML preview of WikiText files (in particular README.md!) displayed in unreadably small fonts (my display has a very small pixel pitch). So I wanted to find a way to set the CSS of such preview pages. The Mylyn WikiText docs (at https://help.eclipse.org/2020-09/index.jsp?topic=%2Forg.eclipse.mylyn.wikitext.help.ui%2Fhelp%2FMylyn+WikiText+User+Guide.html, under the heading "Rendering Appearance") says that there should be a Preferences screen General > Editors > Text Editor > WikiText > Appearance that allows one to set this CSS. However, no such screen shows up in my installation.
The only method I was able to find for fixing this was to use an application (such as Engrampa) which is able to edit the contents of .jar files, and in my eclipse installation directory, use it on plugins/org.eclipse.mylyn.wikitext.ui_3.0.[SPECIFIC_VERSION_HERE].jar to edit the internal component org/eclipse/mylyn/internal/wikitext/ui/viewer/default.css -- I could change any css there, and upon restarting Eclipse, the changes would take effect.
However, clearly any changes I make this way will be blown away upon the next update of Eclipse or of Mylyn Wikitext. Does anyone know of a better way to set the size of the preview text? Was that Appearance pane mentioned in the docs removed? If so, what replaced it? If not, any ideas why I might not be seeing it?

How to quickly open a resource file by hovering on the file name in the code

Suppose a Qt qmake project has a source with a following line of code:
loadTxt(":/libraryNotes.txt");
If I want to open the "libraryNotes.txt" files in the target's resources, I need to go the "Projects" tab, open the "Resources", and look for the file, then click and open it.
Is there any shortcut to do it directly from the code editor pane, when the mouse cursor or text cursor is over the filename? I'm thinking of a way similar to pressing F2 to follow the symbol to its declaration/definition.
Unfortunately, this doesn't seem to be supported in Qt Creator 3.2.2 at least. But it shouldn't be too hard to add, most of the support code is already there.

Windows form application - Icon image location?

I think this should be a relatively easy one to answer, I hope, but is proving to be a bit of a stress!
I have used an Icon on an old application developed some years ago and I would now like to use the icon for a current project.. however..
I added the icon using the upload/import icon-image in the properties window, and did not add it in the project resources file, nor specify its location anywhere in my code, using only the icon tool in the properties window.
Now wanting to find the icon image file to use again, I cannot find it anywhere! I have trawled through all the project files looking for the image file or a ref to its location, but have found nothing; except for:
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
When running the application the icon is still clearly visible in the applications taskbar tile.
Does anyone know where the icon file is stored / how I can retrieve it?
Thank you in advance.
It is stored in "{Your_project_name}.{Form_name}.resources" file. Search inside the "obj" folder which is in your project folder.
Now open the command prompt of Visual Studio. We will convert this ".resources" file into a ".resx" file. We use "resgen" command here.
resgen foo.resources bar.resx
The .resx can then be added to a C# project. You can find your icon file there.

How to change JavaFx native Bundle exe icon

I am trying to chance the icon of the exe file created native bundling of javafx packaging but it still contains the default icon. Please suggest
primaryStage.getIcons().add(FileUtility.loadImage("icon.png"));
did not help, it only changes the title bar and task bar icon.
The ico file still gets generated and icon of the exe files remains the default one
I also tried to assign an icon in the project properties-> Deployment-> icon but did not help
I believe I have encountered the same issue and the solution is described in the following thread.
As a side note - neither specifying your icon in the build.xml file or via the project's options in the deployment section is going to work thus far, but it seems to be fixed in the upcoming release of 7u10.
I added response here How to set custom icon for javafx native package icon on Windows and thinks it is the same issue you started out with. However you seem to have moved on, but others might find it interesting...
I added src/main/deploy/package/windows/myapp.ico there and it finally worked :)
For you:
Create src/main/deploy/package/windows/ folder
Add icon with name ${project.build.finalName}.ico
Run mvn jfx:build-native
I haven't played with it extensively - just got it to work and wanted to share. So if you want to use icon with different name, I don't know how. Not yet at least. The ... section in the config section seems to be for webstart, so I haven't been using it. Hope you get it to work!
Answered at How to set custom icon for javafx native package icon on Windows

QVision Widget Error upon compile

Only one error to go until I get to use this for my research!
Warning: Z-order assignment: " is not a valid widget.
FILE: qvvideoreaderblockwidget.ui
There's no line number that came with it. I tried finding but, failed to see an open-ended part.
What should I do to correctly compile this library?
Edit the ui file outside of Qt Creator. Delete the rows with 'zorder' tags. Then open in Qt Creator and compile again. It worked for me then perfectly, the warning did not appear any more.
OK, I had this, and it irked me too. I don't know what happened to cause this, but it is not serious. I suppose that breaking and remaking all the layouts might fix it. Other frameworks tend toward a lot of warnings, but tho I'm new to Qt, not a one yet. I went in another editor, and removed a line that said (as best I can remember):
<z-order>verticalSpacer</z-order>
which was among a lot of other lines which also were z-order tags. I deleted the line with this tag, and rebuilt all. Problem gone. Interestingly enough, all of the z-order tags had vanished from my file when I looked at it next. It must be a bug, but evidently one of little consequence; except those who hate to see the serene beauty of Qt spoiled.
Does the ui-file qvvideoreaderblockwidget.ui contain "Promoted widgets"? If so, use the "Promoted widgets" dialog of the (Qt4-) designer for ensuring that the header of the promoted widget-class is declared as "global include".
In case the custom widget class is named "MyWidget" and the header is named "mywidget.h" and the member widget shall be named "myWidget", the uic will generate the code of the ui-class as follows:
#include <mywidget.h>
class qvvideoreaderblockwidget
{
public:
MyWidget* myWidget;
// ...
};
It happened to me when I deleted a fairly large chunk of stuff in the designer. Investigation showed that the designer had failed to remove a zorder tag relating to the widget I deleted (which, incidentally contained a bunch of other widgets).
Deleting the line as suggested cleared the problem. If you do have a load of zorder tags you probably need to be careful to just delete the one that relates to the deleted item.
I had the same problem, and deleting the .exe file from the output folder (debug or release) before run/compile the source, solved the problem.
This problem arises due to a (presently) unfixed bug in Qt Creator's undo / delete mechanism.
The solution until the bug is fixed is to:
Close the .ui file in Qt Designer
Open the .ui file in an external editor
Delete the <zorder> line(s) that apply to the element with the problem. For example:
<zorder>groupBox_2</zorder>
Save the file
Re-open the file in Qt Designer
Re-compile in Qt

Resources