254 { |
254 { |
255 if ( IsReadOnly() ) |
255 if ( IsReadOnly() ) |
256 { |
256 { |
257 switch ( aKeyEvent.iCode ) |
257 switch ( aKeyEvent.iCode ) |
258 { |
258 { |
259 case EKeyDevice3: |
259 case EKeyDevice3: |
|
260 { |
|
261 if ( iFindItemEventReceived ) |
|
262 { |
|
263 // Find item was activated by touch, |
|
264 // no need to restore highlight |
|
265 iFindItemEventReceived = EFalse; |
|
266 return EKeyWasNotConsumed; |
|
267 } |
|
268 // fall through |
|
269 } |
260 case EKeyEnter: |
270 case EKeyEnter: |
261 { |
271 { |
262 // Restore highlight |
272 // Restore highlight |
263 const CItemFinder::CFindItemExt& item = |
273 const CItemFinder::CFindItemExt& item = |
264 iItemFinder->CurrentItemExt(); |
274 iItemFinder->CurrentItemExt(); |
306 void CMsgBodyControlEditor::HandleFindItemEventL( |
316 void CMsgBodyControlEditor::HandleFindItemEventL( |
307 const CItemFinder::CFindItemExt& aItem, |
317 const CItemFinder::CFindItemExt& aItem, |
308 MAknItemFinderObserver::TEventFlag aEvent, |
318 MAknItemFinderObserver::TEventFlag aEvent, |
309 TUint aFlags) |
319 TUint aFlags) |
310 { |
320 { |
311 // We will send new EMsgFindItemEvent so that we can separate |
321 // Body text find item was clicked, we will send simulated key event for |
312 // single click item activation and old key based activation. |
322 // opening context sensitive menu in AppUI::HandleKeyEvent |
313 // This is just quick fix for doing it, other implementations should |
|
314 // be considered(e.g. storing state in editor or using some flags). |
|
315 // This is done because in AppUI::HandleKeyEvent we must separate |
|
316 // activation methods for enabling highlight when using keys. |
|
317 if ( MAknItemFinderObserver::EPointerEvent == aEvent ) |
323 if ( MAknItemFinderObserver::EPointerEvent == aEvent ) |
318 { |
324 { |
319 TKeyEvent event; |
325 TKeyEvent event; |
320 event.iCode = EMsgFindItemKeyEvent; |
326 event.iCode = EKeyDevice3; |
321 event.iScanCode = EMsgFindItemKeyEvent; |
327 event.iScanCode = EKeyDevice3; |
322 event.iModifiers = 0; |
328 event.iModifiers = 0; |
323 event.iRepeats = 0; |
329 event.iRepeats = 0; |
324 |
330 |
|
331 iFindItemEventReceived = ETrue; |
325 iCoeEnv->WsSession().SimulateKeyEvent( event ); |
332 iCoeEnv->WsSession().SimulateKeyEvent( event ); |
326 } |
333 } |
327 } |
334 } |
328 |
335 |
329 // --------------------------------------------------------- |
336 // --------------------------------------------------------- |