Search code examples
androidopengl-es-2.0keyevent

What is causing the soft keyboard to stop responding?


I'm experiencing something I cannot describe entirely.

I somehow keep doing something that messes with the soft keyboard, not just in my application, but on the entire device.

So, I'm developing a game with OpenGl ES 2.0. Everything was fine before I implemented the GLSurfaceView, but after that on random occasions the soft keyboard stopped responding in for instance the native messenger app.

I've seen this happen with previous projects of mine, but also on other phones that are not used as debugging devices after installing OpenGl-based games.

The main problem is I don't understand what is causing this, so I don't know where to start looking.

When the keyboard is not responding, it is logging a warning on tapping a key.

02-18 15:08:29.924: W/ViewRootImpl(1261): Dropping event due to no window focus: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_G, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=93568743, downTime=93568743, deviceId=-1, source=0x101 }

It feels like it has something to do with a memory overload, but I can not simulate a situation where it always happens, so I'm not entirely sure.

I would love to provide some code, but as I don't know what is causing this, I don't know what to show.

Thanks


Solution

  • The focus is "hanged" on the glES view. Next time you stumble across this, force-kill the game and see if it still happens.

    Also may be a bug that prevents context-change for input events, but this would manifest only if in some way the gl View got leaked, and the UIService itself is done for.