I am trying to navigate words on the input text field with ctrl+right ctrl+left.
But these key combinations seems to be dropped, they cant reach my code at:
new KeyActionListener(){public void keyAction(TextEntryComponent source, KeyAction key) {...
btw, still on this subject,
to position the carat properly I am having to use a trick:
DocumentModel dm = textfield.getDocumentModel();
dm.home(true);
for(int i=0;i<iMoveCaratTo;i++){
dm.right();
}
// this other trick resets the cursor position visually
tf.setFontSize(tf.getFontSize());
as I cant find a way to call textfield.text[TextEntryComponent].resetCursorPosition() directly
any tip to avoid using this trick?
EDIT: I use this after a paste text insert in the middle region of the textfield string
I think it’s some missing functionality from DocumentModel… on two counts:
inserting text should probably automatically move the carat.
there should be a way to manually set the carat index. If one can get it then one should be able to set it, after all.
And the other I think is a bug.
Not sure when I can get to a fix for any of it… so your work-around may have to stand for a while unless you get really fed up with it and submit a patch.
EDIT: working! below I keep just for reference, I just had to add the file named lemur.build.date with the content ex.: 20161204
EDIT: ugh… below seems related to build.xml, I think I can do it by hand without netbeans…
it compiles, but I am having a problem (at Eclipse), I am not being able to actually test it:
java.lang.IllegalArgumentException: resource lemur.build.date not found.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:119)
at com.google.common.io.Resources.getResource(Resources.java:157)
at com.simsilica.lemur.GuiGlobals.logBuildInfo(GuiGlobals.java:194)
at com.simsilica.lemur.GuiGlobals.setInstance(GuiGlobals.java:125)
at com.simsilica.lemur.GuiGlobals.initialize(GuiGlobals.java:119)
at com.simsilica.lemur.demo.BasicDemo.simpleInitApp(BasicDemo.java:97)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
at java.lang.Thread.run(Thread.java:745)