My final quirk is with using the shift key to produce capital letters. Right now, my edit box solely produces capital letters. I can't type in a lower case letter. I'm using the same code I used for my backspace key which works great. Here's the right shift, the left shift is the same, except for the obvious changed like using Key::LeftShift instead of Key::RightShift:
Code: Select all
if(guiManager->alreadyDown(DIK_RSHIFT))
{
if(KeyState(DIK_RSHIFT) == TRUE)
{
CEGUI::Key::Scan k;
k = CEGUI::Key::RightShift;
guiManager->injectKeyPress(k);
guiManager->setDown(DIK_RSHIFT);
}
else
{
CEGUI::Key::Scan k;
k = CEGUI::Key::RightShift;
guiManager->injectKeyUp(k);
guiManager->setUp(DIK_RSHIFT);
}
}
else
{
if(KeyState(DIK_RSHIFT) == TRUE)
{
CEGUI::Key::Scan k;
k = CEGUI::Key::RightShift;
guiManager->injectKeyPress(k);
guiManager->setDown(DIK_RSHIFT);
}
}
The strange part is that when I tap the left shift key, I get bullets in the edit box. Yes, bullets. When I tap the right shift key, I get 6s (sixes) LOL. I'm not sure what I'm doing wrong here. All I need to do is inject scan codes for up and downs right?