Hi, I currently try to find this in the Inputmanager, but fail to find it.
Is there any way to simulate keyevents in jme?
Baiscally I have two uses for this;
-
automated testing, by building a player bot that does some procedures like build a complete spaceship and check the results if I introduced errors. (And yes I know i could do this via robot, but it makes it way more instable that way, as the jme window position suddenly is important, the resolution ect. When in just need to do like press a,w,d,d,l,n
-
JME-JFX consumes events it thinks that are for JFX, however occasinally it consumes events it should not consume.
Eg it has focus , and thus consumes a key press, however it is found out it has no handler instead the key was meant for jme itself. (Like pressing W to walk forward while jfx has focue) I now want to unfocus jfx 8the easier part) and then redirect the event again to jme, so that it behaves as expected. Since jfx runs in a different thread, there is no easy way to detect such cases before the event is transfered to jfx in the first place.
From my seeing I could use onKeyEvent to push my events into JME, however I would need to do so in the ventsPermitted phase, any ideas how to archive this?
My currently hacky idea would be to use a RawInputListener, add a queue to it, and on beginInput inject my own events, however this feels pretty dirty.
Do I miss something, or is there simply no way to simulate Events currently?