CleverRaven/Cataclysm-DDA — pull request #9151 by sankao (2014-09-21 03:59:53+00:00)
Title: [CR] hack to handle commands on key down in linux vm sdl tile mode

When running the game on a Linux (ubuntu 14.04) through virtualbox (windows 7 host), the game commands (e.g. pressing [i] for inventory) do not respond.

Looking through the code (src/sdltiles.cpp), it looks like they are supposed to be fired through SDL_TEXTINPUT events, but such events are never received. According to SDL documentation, SDL_StartTextInput should be called before receiving SDL_TEXTINPUT events, but it is not called at the moment. It appears to be called implicitly during the sdl initialization process. Manually calling SDL_StartTextInput does not solve the problem.

Surprisingly, sample SDL text input handling code such as http://lazyfoo.net/tutorials/SDL/32_text_input_and_clipboard_handling/index.php does fire SDL_TEXTINPUT events properly, so the issue does not seem to come solely on the vm keyboard emulation.

The provided hack passes key events through the KEY_DOWN event and is *not* a proper fix. It should however work for simple key presses, and may help some users in the same situation as me.

I know the issue may seem trivial, but if one of the maintainers could point me in the right direction, it would be much appreciated.