Swing and keyInput problem

Hey all,

I’m trying to use canvas in jme2, when I use canvas without swing, all is ok.

But problem is when I use canvas with swing like in JMESwingTest


and I add sth in update function:

[java] public void simpleUpdate() {

if (KeyInput.get().isShiftDown())


System.out.println(“shift is down”);



This work properly only if canvas is active (after I click on this);/

I tried make JFrame listener but this isn’t good, becouse it only react on

event, and this isn’t look as good as in simplegame. I need list keys every update.

Please help

any ideas?