I have made my first PlayN app and it works just great until it is embedded somewhere with iframe.
In my init() function I have this code for keyboard:
Keyboard k = PlayN.keyboard();
k.setListener(new Listener() {
@Override
public void onKeyUp(Event event) {
}
@Override
public void onKeyDown(Event event) {
/* long long code was here */
}
@Override
public void onKeyTyped(TypedEvent event) {
}
});
This works well, but not with iframe. It simply doesn't have the focus or something.
I found a workaround for this: quickly press F5 and quickly ckick the iframe few times before it is loaded. But I want something to do it automatically.
Examples: with iframe (this have input problems), no iframe (this works well).
I've had this issue as well. I believe the fix that worked for me was adding the following to the main .html file:
Credit to this post if it works for you.