src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.cpp
changeset 7 923ff622b8b9
parent 6 c3690ec91ef8
child 21 4633027730f5
child 34 ed14f46c0e55
equal deleted inserted replaced
6:c3690ec91ef8 7:923ff622b8b9
    34 #include "hbinput12keytouchkeyboard_p.h"
    34 #include "hbinput12keytouchkeyboard_p.h"
    35 #include "hbinputbuttongroup.h"
    35 #include "hbinputbuttongroup.h"
    36 #include "hbinputbutton.h"
    36 #include "hbinputbutton.h"
    37 #include "hbinputmodeindicator.h"
    37 #include "hbinputmodeindicator.h"
    38 
    38 
    39 const qreal HbKeyboardHeightInUnits = 37.8;
    39 const qreal HbKeyboardHeightInUnits = 36.9;
    40 const qreal HbKeyboardWidthInUnits = 53.8;
    40 const qreal HbKeyboardWidthInUnits = 53.8;
    41 
    41 
    42 const int HbFirstRowIndex = 0;
    42 const int HbFirstRowIndex = 0;
    43 const int HbSecondRowIndex = 2;
    43 const int HbSecondRowIndex = 2;
    44 const int HbVirtual12KeyNumberOfRows = 4;
    44 const int HbVirtual12KeyNumberOfRows = 4;
   252                 }
   252                 }
   253 
   253 
   254                 ++key;
   254                 ++key;
   255             } else if (keyCode(i) == HbInputButton::ButtonKeyCodeShift) {
   255             } else if (keyCode(i) == HbInputButton::ButtonKeyCodeShift) {
   256                 if (mMode == EModeNumeric) {
   256                 if (mMode == EModeNumeric) {
   257                     item->setText(QString("#"), HbInputButton::ButtonTextIndexSecondaryFirstRow);
   257                     item->setIcon(HbIcon(), HbInputButton::ButtonIconIndexPrimary);
       
   258                     item->setText(QString("#"), HbInputButton::ButtonTextIndexPrimary);
       
   259                     item->setText(QString(), HbInputButton::ButtonTextIndexSecondaryFirstRow);
   258                 } else if (mMode == EModeAbc) {
   260                 } else if (mMode == EModeAbc) {
       
   261                     item->setIcon(HbIcon(HbInputButtonIconShift), HbInputButton::ButtonIconIndexPrimary);
   259                     item->setText(QString(" "), HbInputButton::ButtonTextIndexSecondaryFirstRow);
   262                     item->setText(QString(" "), HbInputButton::ButtonTextIndexSecondaryFirstRow);
       
   263                 }
       
   264             } else if (keyCode(i) == HbInputButton::ButtonKeyCodeAsterisk) {
       
   265                 if (mMode == EModeNumeric) {
       
   266                     item->setText(QString("*"), HbInputButton::ButtonTextIndexPrimary);
       
   267                     item->setText(QString(""), HbInputButton::ButtonTextIndexSecondaryFirstRow);
       
   268                 } else if (mMode == EModeAbc) {
       
   269                     item->setText(QString("*"), HbInputButton::ButtonTextIndexPrimary);
       
   270                     item->setText(QString("+"), HbInputButton::ButtonTextIndexSecondaryFirstRow);
   260                 }
   271                 }
   261             }
   272             }
   262         }
   273         }
   263         buttonGroup->setButtons(buttons);
   274         buttonGroup->setButtons(buttons);
   264     }
   275     }
   342     result.setWidth(HbKeyboardWidthInUnits * unitValue);
   353     result.setWidth(HbKeyboardWidthInUnits * unitValue);
   343 
   354 
   344     return QSizeF(result);
   355     return QSizeF(result);
   345 }
   356 }
   346 
   357 
       
   358 /*!
       
   359 Sends key event to owning input method.
       
   360 */
       
   361 void Hb12KeyTouchKeyboard::sendLongPressEvent(const QKeyEvent &event)
       
   362 {
       
   363     Q_D(Hb12KeyTouchKeyboard);
       
   364     if (d->mMode == EModeAbc) {
       
   365         HbInputButtonGroup *buttonGroup = static_cast<HbInputButtonGroup*>(contentItem());
       
   366         if (buttonGroup) {
       
   367             buttonGroup->cancelButtonPress();
       
   368         }
       
   369     }
       
   370     HbInputVkbWidget::sendLongPressEvent(event);
       
   371 }
       
   372 
   347 // End of file
   373 // End of file