Page MenuHome

Fix T40179: BGE: Can not input Chinese/Korean/Japanese in a game exported. East Asian user needs it.
AbandonedPublic

Authored by Julian Eisel (Severin) on May 31 2014, 8:31 AM.

Details

Summary

This allows BGE to receive CJK characters from input method via KeyboardSensor with "All Keys" option. Currently, this works only on Linux (X11). For Windows and OSX, OS dependent part (GHOST) still needs input method support.

Technical notes:

  1. Some new constants to indicate an input method event are defined:
    • GHOST_kKeyInputMethod (GHOST)
    • INPUTMETHOD (windowmanager)
    • KX_INPUTMETHOD (gameengine)
  2. Input method throws only keypress event, never throws keyrelease event, so NextFrame() changes the event status from KX_JUSTACTIVATED to KX_NO_INPUTSTATUS immediately after the keypress event is consumed.
  3. The unicode characters from input method are stored in m_IMUnicodeBuf rather than m_eventStatusTables before sending them to KeyboardSensor, because the input method can send multiple characters in one event loop.

Diff Detail

Branch
BGE_i18n_support_input_method

Event Timeline

The BGE code looks good to me.

source/gameengine/GameLogic/SCA_IInputDevice.h
318

Does it make sense to have these in SCA_IInputDevice? Probably not, but we don't have a generic keyboard device class that both GPC_KeyboardDevice and KX_BlenderKeyboardDevice share. So, I guess this can go here.

Julian Eisel (Severin) commandeered this revision.EditedDec 1 2014, 4:40 PM

I think since we're working on IME support (D765) - at least for Windows - we can abandon this one

Nevertheless, thanks for the work and the patch @Shinsuke Irie (irie) :)