I have a full featured application using CEGUI and Producer. I have the mouse input handled properly, finally, and now I am focusing on correctly implementing the character input. Here is a snapshot of my code, which does work:
Code: Select all
void Injector::keyPress(Producer::KeyCharacter key)
{
//CEGUI::System::getSingleton().injectKeyDown( static_cast<CEGUI::uint>(key) );
CEGUI::System::getSingleton().injectChar( static_cast<CEGUI::utf32>( key ) );
}
void Injector::keyRelease(Producer::KeyCharacter key)
{
//CEGUI::System::getSingleton().injectKeyUp( static_cast<CEGUI::uint>(key) );
CEGUI::System::getSingleton().injectChar( static_cast<CEGUI::utf32>( key ) );
}
I would prefer to use the commented code. It will compile, but it produces no results. The uncommented code is currently being used and it allows me to edit text fields. Why doesn't the commented one work? BTW, a Producer::KeyCharacter is just a typedef for some ascii code, defined like this excerpt shows:
Code: Select all
enum KeyCharacter
{
...
KeyChar_X = 0x058,
KeyChar_Y = 0x059,
KeyChar_Z = 0x05a,
KeyChar_bracketleft = 0x05b,
KeyChar_backslash = 0x05c,
KeyChar_bracketright = 0x05d,
KeyChar_asciicircum = 0x05e,
KeyChar_underscore = 0x05f,
KeyChar_grave = 0x060,
KeyChar_quoteleft = 0x060,
KeyChar_a = 0x061,
KeyChar_b = 0x062,
KeyChar_c = 0x063,
....
};
Thanks, -granx