javauis/lcdui_akn/lcdui/src/CMIDEdwin.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 71 d5e927d5853b
--- a/javauis/lcdui_akn/lcdui/src/CMIDEdwin.cpp	Wed Sep 15 12:05:25 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDEdwin.cpp	Wed Oct 13 14:23:59 2010 +0300
@@ -20,7 +20,7 @@
 #include <eikappui.h>
 #include <coecntrl.h>
 // macros for resources
-#include <eikcoctl.rsg>
+#include <EIKCOCTL.rsg>
 
 #include <AknUtils.h>
 // usied for playing error sounds when text input
@@ -770,8 +770,7 @@
         {
             CEikEdwin::SetCursorPosL(cursorPos + 1, EFalse);
         }
-        else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength &&
-                 (scanCode == EStdKeyFullStop || scanCode == EStdKeyMinus))
+        else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength && scanCode==EStdKeyFullStop)
         {
             CEikEdwin::SetCursorPosL(iMaxSize, EFalse);
         }
@@ -841,7 +840,7 @@
         }
     }
 
-    if (aType != EEventKey && aKeyEvent.iScanCode != EStdKeyApplication0)
+    if (aType != EEventKey)
     {
         UpdateTextCapacityIndicatorValueL();
         return EKeyWasConsumed;
@@ -850,16 +849,13 @@
 
     TKeyResponse response = EKeyWasNotConsumed;
 
-    // Error tone playing case2:
-    // Play error tone if TextBox/TextField is read-only or maximum length has been reached.
-    // Here is handling of full keyboard keys(NOT 0...9) and all virtual keyboard keys
-    // (camera and menu key not included).
-    // (Note: Virtual keyboard sends only EEventKey type events, not up or down events)
-    // (Note: Error tone is played when there is no text to be replaced i.e. no text has been painted)
-    if (!iEdwinUtils->IsNavigationKey(aKeyEvent) && !iEdwinUtils->IsHotKeyL(aKeyEvent, iCoeEnv) && aKeyEvent.iCode != EKeyYes &&
-            (!iKeyEventsPending || (scanCode < KKeyQwerty0  || scanCode > KKeyQwerty9)) &&
-            (aKeyEvent.iCode != EKeyApplication0 && scanCode != EStdKeyApplication0 &&
-             aKeyEvent.iCode != EKeyApplication19 && scanCode != EStdKeyApplication19))
+    //Error tone playing case2:
+    //Play error tone if TextBox/TextField is read-only or maximum length has been reached.
+    //Here is handling of full keyboard keys(NOT 0...9) and all virtual keyboard keys.
+    //(Note: Virtual keyboard sends only EEventKey type events, not up or down events)
+    //(Note: Error tone is played when there is no text to be replaced i.e. no text has been painted)
+    if (!iEdwinUtils->IsNavigationKey(aKeyEvent) && !iEdwinUtils->IsHotKeyL(aKeyEvent, iCoeEnv) && !aKeyEvent.iCode == EKeyYes &&
+            (!iKeyEventsPending || (scanCode < KKeyQwerty0  || scanCode > KKeyQwerty9)))
     {
         if (IsReadOnly() || (TextLength() >= iMaxSize && aKeyEvent.iCode != EKeyBackspace))
         {
@@ -926,21 +922,14 @@
                 if (res && TChar(aKeyEvent.iCode) == TChar('-') &&
                         TextLength() < iMaxSize)
                 {
-                    TInt textLength = TextLength();
                     res->InsertL(GetCaretPosition(), KMinusChar);
                     HandleTextChangedL(); // notify editor about the text changes
                     CEikEdwin::ReportEdwinEventL(EEventTextUpdate);
-                    TInt cursorPos = GetCaretPosition();
 
                     if (TextLength() < iMaxSize)
                     {
                         CEikEdwin::SetCursorPosL(GetCaretPosition() + 1, EFalse);
                     }
-                    else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength)
-
-                    {
-                        CEikEdwin::SetCursorPosL(iMaxSize, EFalse);
-                    }
                 }
             }