textinput/peninputarc/src/peninputanim/peninputanim.cpp
branchRCL_3
changeset 22 bd83ceabce89
parent 21 ecbabf52600f
equal deleted inserted replaced
21:ecbabf52600f 22:bd83ceabce89
   239             break;
   239             break;
   240             }
   240             }
   241         case TRawEvent::EButton1Up:
   241         case TRawEvent::EButton1Up:
   242             {
   242             {
   243             pointerEvent.iType = TPointerEvent::EButton1Up;
   243             pointerEvent.iType = TPointerEvent::EButton1Up;
       
   244             pointerEvent.iPosition = aRawEvent.Pos();
   244             break;
   245             break;
   245             }
   246             }
   246         case TRawEvent::EPointerMove:
   247         case TRawEvent::EPointerMove:
   247             {
   248             {
   248             pointerEvent.iType = TPointerEvent::EDrag;
   249             pointerEvent.iType = TPointerEvent::EDrag;
   257     if ( result )
   258     if ( result )
   258         {
   259         {
   259         return ETrue;
   260         return ETrue;
   260         }
   261         }
   261 
   262 
       
   263     TRawEvent rawEvent = aRawEvent;
       
   264     if ( aRawEvent.Type() == TRawEvent::EButton1Up 
       
   265          && aRawEvent.Pos() != pointerEvent.iPosition )
       
   266         {
       
   267         rawEvent.Set( TRawEvent::EButton1Up, 
       
   268                       pointerEvent.iPosition.iX, 
       
   269                       pointerEvent.iPosition.iY );
       
   270         }
   262     
   271     
   263     switch(aRawEvent.Type())
   272     switch(aRawEvent.Type())
   264         {
   273         {
   265         case TRawEvent::EKeyUp:
   274         case TRawEvent::EKeyUp:
   266         case TRawEvent::EKeyDown:
   275         case TRawEvent::EKeyDown:
   267             {
   276             {
   268             return OnRawKeyEvent(aRawEvent);            
   277             return OnRawKeyEvent( rawEvent );            
   269             }
   278             }
   270         case TRawEvent::EButton1Down:
   279         case TRawEvent::EButton1Down:
   271             {
   280             {
   272             TBool used = OnRawButton1Down(aRawEvent);
   281             TBool used = OnRawButton1Down( rawEvent );
   273             
   282             
   274             if ( used )
   283             if ( used )
   275                 {
   284                 {
   276                 StartTimer();
   285                 StartTimer();
   277                 }
   286                 }
   278             
   287             
   279             return used;
   288             return used;
   280             }
   289             }
   281         case TRawEvent::EButton1Up:
   290         case TRawEvent::EButton1Up:
   282             {
   291             {
   283             TBool used = OnRawButton1Up(aRawEvent);
   292             TBool used = OnRawButton1Up( rawEvent );
   284             StopTimer();
   293             StopTimer();
   285             return used;
   294             return used;
   286             }
   295             }
   287         case TRawEvent::EPointerMove:
   296         case TRawEvent::EPointerMove:
   288             {
   297             {
   289             return OnRawPointerMove(aRawEvent);
   298             return OnRawPointerMove( rawEvent );
   290             }
   299             }
   291         default:
   300         default:
   292             {
   301             {
   293             return EFalse;
   302             return EFalse;
   294             }            
   303             }
   295         }    
   304         }
   296     }
   305     }
   297 
   306 
   298 // ---------------------------------------------------------------------------
   307 // ---------------------------------------------------------------------------
   299 // CPeninputAnim::Command
   308 // CPeninputAnim::Command
   300 // The window server calls this function in response to application 
   309 // The window server calls this function in response to application 
   693             TPckg<TRect> msgData(area);
   702             TPckg<TRect> msgData(area);
   694             msg->ReadL(KMsgSlot1,msgData);
   703             msg->ReadL(KMsgSlot1,msgData);
   695             SetDiscreeptPop(area); 
   704             SetDiscreeptPop(area); 
   696             }
   705             }
   697             break;
   706             break;
       
   707         case EPeninputOpUpdatePointerSuppressor:
       
   708             {
       
   709             TPointerEventSuppressorParameters parameters;
       
   710             TPckg<TPointerEventSuppressorParameters> msgData( parameters );
       
   711             msg->ReadL( KMsgSlot1, msgData );
       
   712             
       
   713             iPointerEventSuppressor->SetMaxTapMove( parameters.iMoveEventMaxMovement );
       
   714             iPointerEventSuppressor->SetMaxTapDuration( parameters.iMoveEventTimeout );
       
   715             iPointerEventSuppressor->SetMaxDownUpMove( parameters.iUpEventMaxMovement );
       
   716             iPointerEventSuppressor->SetMaxDownUpDuration( parameters.iUpEventTimeout );
       
   717             }
       
   718             break;
   698         default:
   719         default:
   699             // unsupported opcode, panic the client
   720             // unsupported opcode, panic the client
   700             {                
   721             {                
   701             iFunctions->Panic();
   722             iFunctions->Panic();
   702             retValue = KErrNotSupported;
   723             retValue = KErrNotSupported;