In Java 7 and higher, the NEO2 Keyboard layout works fine out of the box with most programs, so you prabably need not bother with this hack.
The only exception is Android Studio / IntelliJ, where the main editor component is so customized that it handles the AWT events differently from normal text edit widgets. (See https://youtrack.jetbrains.com/issue/IDEA-113997 and http://wiki.neo-layout.org/ticket/364)
If you use Java 6, the hack in the "Java 6" branch should work for you. (forgot to backup a binary somewhere - sorry)
Even More Important Notice
THIS IS A VERY NASTY HACK/WORKAROUND. I TAKE NO RESPONSIBLE WHATSOEVER TO ANY DAMAGE IT MIGHT CAUSE!
NEO2 AWT Hack
This is the version for Java 8, Linux, tested with official Oracle JDK (it should work on openjdk 8 as well).
If you need a version for Java7, just get the source for the respective version of the
KeyEvent class and apply the hack. To find the modified parts, just grep for "begin of ugly hack" in the current version.
If you successfully use it for OpenJDK 8, please let me know.
This is a nasty hack to enable the neo 2 keyboard layout in IntelliJ / Android Studio / PyCharm under X11 (e.g. Linux).
The neo 2 keyboard layout uses additional modifiers that enable additional keyboard layers. These do not work in the IntelliJ main editor widget.
This hack contains a modified version of the java class
java.awt.KeyEvent. This modified version contains an additional lookup into a hardcoded
array that maps to the appropriate key code if one of the known broken keys is pressed.
By adding the patched class to the bootclasspath it gets loaded before the "proper" class shipped with the JRE, which causes the patch to be used when mapping keycodes.
Simply compile with maven:
mvn clean package
Add it to the bootclasspath of your java application like so:
java -Xbootclasspath/p:/your/path/to/the/jar/neo2-awt-hack-0.4-java8oracle.jar -cp foo.jar com.example.Foo
Most java applications are started using some script, in this case you either have to modify the script or some config file that contains parameters for the JVM.
For IntelliJ, you have to modify your
idea.vmoptions file and add the following line:
For Android Studio the file is
For PyCharm it is
vmoptions files of IntelliJ based IDEs can be found in the
bin folder of the IDE installation.
You can download a binary from https://github.com/chenkelmann/neo2-awt-hack/blob/master/releases/neo2-awt-hack-0.4-java8oracle.jar?raw=true