2327 someone accepts the hotkey, to only offering the hot key to the current line and then, only if |
2327 someone accepts the hotkey, to only offering the hot key to the current line and then, only if |
2328 it accepts hotkeys. |
2328 it accepts hotkeys. |
2329 |
2329 |
2330 Added Enter key as a special case... |
2330 Added Enter key as a special case... |
2331 */ |
2331 */ |
|
2332 |
2332 if ( (iCurrentLine!=-1) && (iCurrentLine < iLines->Count()) ) |
2333 if ( (iCurrentLine!=-1) && (iCurrentLine < iLines->Count()) ) |
|
2334 { |
2333 if ( (*iLines)[iCurrentLine]->OfferHotKeys() || |
2335 if ( (*iLines)[iCurrentLine]->OfferHotKeys() || |
2334 (*iLines)[iCurrentLine]->TakesEnterKey() && (aKeyEvent.iCode==EKeyEnter) |
2336 (*iLines)[iCurrentLine]->TakesEnterKey() && (aKeyEvent.iCode==EKeyEnter) |
2335 ) |
2337 ) |
|
2338 { |
|
2339 CEikCaptionedControl* currentLine = ( *iLines )[iCurrentLine]; |
|
2340 const TInt controlType( currentLine->iControlType ); |
|
2341 |
|
2342 if ( currentLine->ControlIsAnEdwin( controlType ) ) |
|
2343 { |
|
2344 CEikEdwin* edwin = ( CEikEdwin* )currentLine->iControl; |
|
2345 TBool readOnly = edwin->IsReadOnly(); |
|
2346 |
|
2347 // The control is an editor which is read-only, |
|
2348 // such as an on/off control |
|
2349 if ( readOnly ) |
|
2350 { |
|
2351 iPageObserver->HandleDialogPageEventL( |
|
2352 MEikDialogPageObserver::EDialogPageTapped ); |
|
2353 return EKeyWasConsumed; |
|
2354 } |
|
2355 } |
|
2356 |
2336 if (!IsForm()|| iIsEditable) |
2357 if (!IsForm()|| iIsEditable) |
|
2358 { |
2337 return (*iLines)[iCurrentLine]->iControl->OfferKeyEventL(aKeyEvent,aType); |
2359 return (*iLines)[iCurrentLine]->iControl->OfferKeyEventL(aKeyEvent,aType); |
|
2360 } |
|
2361 } |
|
2362 } |
2338 return EKeyWasNotConsumed; |
2363 return EKeyWasNotConsumed; |
2339 } |
2364 } |
2340 |
2365 |
2341 TBool CEikDialogPage::TakesEnterKey() |
2366 TBool CEikDialogPage::TakesEnterKey() |
2342 { |
2367 { |
2997 { |
3022 { |
2998 if ( !iPhysics->StartFlick( drag, iExtension->iStartTime ) ) |
3023 if ( !iPhysics->StartFlick( drag, iExtension->iStartTime ) ) |
2999 { |
3024 { |
3000 iExtension->iScrolling = EFalse; |
3025 iExtension->iScrolling = EFalse; |
3001 |
3026 |
3002 if ( iPageObserver && GrabbingComponent() && !iExtension->iWasScrolling ) |
3027 if ( iPageObserver && GrabbingComponent() |
|
3028 && !iExtension->iWasScrolling |
|
3029 && touchedLine == iCurrentLine ) |
3003 { |
3030 { |
3004 iPageObserver->HandleDialogPageEventL( MEikDialogPageObserver::EDialogPageTapped ); |
3031 iPageObserver->HandleDialogPageEventL( MEikDialogPageObserver::EDialogPageTapped ); |
3005 } |
3032 } |
3006 } |
3033 } |
3007 else |
3034 else |
3050 aPointerEvent.iType == TPointerEvent::EButton1Up && |
3077 aPointerEvent.iType == TPointerEvent::EButton1Up && |
3051 touchedLine == iCurrentLine && |
3078 touchedLine == iCurrentLine && |
3052 ( iExtension->iFocusedClicked || iExtension->iUsesSingleClick ) && |
3079 ( iExtension->iFocusedClicked || iExtension->iUsesSingleClick ) && |
3053 !iExtension->iScrolling ) |
3080 !iExtension->iScrolling ) |
3054 { |
3081 { |
3055 mskPress = ETrue; |
3082 // Not need to sent key event when focus lost. |
|
3083 CEikCaptionedControl* currentLine = (*iLines)[iCurrentLine]; |
|
3084 if ( currentLine->IsFocused() ) |
|
3085 { |
|
3086 mskPress = ETrue; |
|
3087 } |
|
3088 |
3056 callDefaultImplementation = EFalse; |
3089 callDefaultImplementation = EFalse; |
3057 } |
3090 } |
3058 if ( callDefaultImplementation && ( iExtension->iFocusedClicked || |
3091 if ( callDefaultImplementation && ( iExtension->iFocusedClicked || |
3059 iExtension->iUsesSingleClick ) && newLine && |
3092 iExtension->iUsesSingleClick ) && newLine && |
3060 !iExtension->iWasScrolling ) |
3093 !iExtension->iWasScrolling ) |