Game Development Community

IME input bug?

by KevinYuen · in Torque 2D Beginner · 03/09/2013 (5:23 am) · 4 replies

static void processCharMessage( WPARAM wParam, LPARAM lParam )
{
  ....
   InputEvent event;

   event.deviceInst = 0;
   event.deviceType = KeyboardDeviceType;
   event.objType    = SI_KEY;
   event.action     = SI_MAKE;
   event.ascii      = charCode;

   // Deal with some silly cases like <BS>. This might be indicative of a 
   // missing MapVirtualKey step, not quite sure how to deal with this.
   if(event.ascii == 0x8)
      event.objInst = KEY_BACKSPACE; //  Note we abuse objInst.

   Game->postEvent(event);
  ....
}

....

bool GuiTextEditCtrl::onKeyDown(const GuiEvent &event)
{
   .....
   else if (event.modifier & SI_CTRL)
   {
     .....; Must arrive here!
   }
   .....
   if ( mFont->isValidChar( event.ascii ) )
   {
     ....; Never arrive here!
   }
}

//because:

InputEvent() { type = InputEventType; size = sizeof(InputEvent); dMemset(touchesX, 0, sizeof(touchesX)); 
                                                                 dMemset(touchesY, 0, sizeof(touchesY));
                                                                 dMemset(touchIDs, 0, sizeof(touchIDs));}
modifier was not init! so value is 0xcc not zero!

#1
03/09/2013 (5:32 am)
Please check codes about ime input for Friends from Asia :)

i like torque2d, but my english is not good, sorry! :(

IME debug:

1: Unable to entered.

if add code: event.modifier = 0:

result like this : ceshi 试测





#2
03/09/2013 (6:35 am)
Internationalization has been kind of broken for a long time. It will take some work to get it back up to speed I think....
#3
03/11/2013 (5:17 am)
I'd also like to see this on the to-do list with some priority to it. Living in Japan might be a small factor in that :P
#4
03/16/2013 (6:39 am)
I hope torquers can give priority to this issue. it's very important to us. thank you for your reply. :)