fixed displaying special chars in the keychange menu
authorConstantin Wenger <constantin.wenger@googlemail.com>
Tue, 2 Aug 2011 08:44:25 +0000 (10:44 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 5 Aug 2011 06:45:15 +0000 (08:45 +0200)
src/guiKeyChangeMenu.cpp

index 6e41677ce33b21d234ca1c441cc459374769d9ff..cdf32d176fc5294c81d62a28467a1e1bf4cdf72f 100644 (file)
@@ -76,7 +76,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
        recalculateAbsolutePosition(false);
 
        v2s32 topleft(0, 0);
-
+       changeCtype("");
        {
                core::rect < s32 > rect(0, 0, 125, 20);
                rect += topleft + v2s32(25, 3);
@@ -303,6 +303,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
                Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON,
                wgettext("Cancel"));
        }
+       changeCtype("C");
 }
 
 void GUIKeyChangeMenu::drawMenu()
@@ -417,6 +418,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
        if (event.EventType == EET_KEY_INPUT_EVENT && activeKey >= 0
                        && event.KeyInput.PressedDown)
        {
+               changeCtype("");
                if (activeKey == GUI_ID_KEY_FORWARD_BUTTON)
                {
                        this->forward->setText(
@@ -495,7 +497,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
                                        narrow_to_wide(KeyNames[event.KeyInput.Key]).c_str());
                        this->key_dump = event.KeyInput.Key;
                }
-
+               changeCtype("C");
                activeKey = -1;
                return true;
        }
@@ -514,6 +516,12 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
                }
                if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED)
                {
+                       if(event.GUIEvent.Caller->getID() != GUI_ID_BACK_BUTTON &&
+                               event.GUIEvent.Caller->getID() != GUI_ID_ABORT_BUTTON)
+                       {
+                               changeCtype("");
+                       }
+
                        switch (event.GUIEvent.Caller->getID())
                        {
                        case GUI_ID_BACK_BUTTON: //back
@@ -590,6 +598,7 @@ bool GUIKeyChangeMenu::OnEvent(const SEvent& event)
                                break;
                        }
                        //Buttons
+                       changeCtype("C");
 
                }
        }