src/hbplugins/inputmethods/touchinput/hbinputqwerty10x4touchkeyboard.cpp
changeset 7 923ff622b8b9
parent 2 06ff229162e9
child 34 ed14f46c0e55
--- a/src/hbplugins/inputmethods/touchinput/hbinputqwerty10x4touchkeyboard.cpp	Wed Jun 23 18:33:25 2010 +0300
+++ b/src/hbplugins/inputmethods/touchinput/hbinputqwerty10x4touchkeyboard.cpp	Tue Jul 06 14:36:53 2010 +0300
@@ -36,7 +36,7 @@
 #include "hbinputbutton.h"
 #include "hbinputmodeindicator.h"
 
-const qreal HbKeyboardHeightInUnits = 34.6;
+const qreal HbKeyboardHeightInUnits = 33.7;
 const qreal HbKeyboardWidthInUnits = 95.5;
 
 const int HbVirtualQwertyNumberOfRows = 4;
@@ -148,18 +148,26 @@
     if (buttonGroup) {
         QList<HbInputButton*> buttons = buttonGroup->buttons();
         for (int i = 0; i < buttons.count(); ++i) {
-            if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) {
-                HbInputButton *item = buttons.at(i);
-
-                HbInputButton::HbInputButtonState state = item->state();
+            HbInputButton *item = buttons.at(i);
+            HbInputButton::HbInputButtonState state = item->state();
+            if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) {        
                 QString data = item->text(HbInputButton::ButtonTextIndexPrimary);
                 if (data.isEmpty() || !focusedObject->characterAllowedInEditor(data.at(0))) {
                     state = HbInputButton::ButtonStateDisabled;
                 } else if (item->state() == HbInputButton::ButtonStateDisabled) {
                     state = HbInputButton::ButtonStateReleased;
                 }
-                item->setState(state);
             }
+            else if (keyCode(i) == HbInputButton::ButtonKeyCodeSpace) {
+                bool allowed = focusedObject->characterAllowedInEditor(QChar(' '));
+                if (!allowed) {
+                    state = HbInputButton::ButtonStateDisabled;
+                }
+                else if (item->state() == HbInputButton::ButtonStateDisabled) {
+                    state = HbInputButton::ButtonStateReleased; 
+                }
+            }
+            item->setState(state);
         }
         buttonGroup->setButtons(buttons);
     }