开发者

Touch event doesn't work in SettingsList (5th Ed SDK)

I'm using Carbide.C++ 2.7 with S60 5th Ed SDK to crea开发者_JS百科te my application,

after I added a SettingsList to my application I removed the "Change" item from "Options Menu", And I changed the "Exit" to "Back" and I set the left button title empty - instead of Options - and the problem is that when I touch any item of SettingsList items there is no response, And I have to use the "Enter Key" to open the item editor - whether it's a Volume item or Binary item, etc - So what is missing or causing this issue ?

any suggestions would be appreciated because I couldn't find difference between two SettingsList created using different SDKs.

I created another application with S60 3rd Ed FP1 SDK - as a simple test - and I tried it and it works fine with Double Tap Touch and Enter Key. ( tested on E7).

And I created the same sample with S60 5th Ed , and removed the "Change" menu but it doesn't response to touch event, but response to Enter Key event only . ( tested on E7).

I compared both projects in Carbide Event/properties views and they are the same, I opened both projects src files and they are the same.

Many thanks in advance.


I figured out that Carbide.C++ doesn't include by default "Touch" event handling even if I'm creating my application using 5th Ed SDK that supports "Touch" event. So I need to add EAknTouchCompatible.

void AppUi::ConstructL()
{
    // [[[ begin generated region: do not modify [Generated Contents]

        BaseConstructL( EAknEnableSkin  | EAknEnableMSK | EAknTouchCompatible);
        InitializeContainersL();

   // ]]] end generated region [Generated Contents]
}

And to Activate the Item Editor with "One Tap" we need to override the virtual function supported by MEikListBoxObserver

void CSettingItemList::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
{
    if (aEventType == EEventItemClicked || aEventType == EEventEnterKeyPressed || aEventType == EEventItemSingleClicked)
           {
               //Now with one Tap it opens the control editor.
               //Using EFalse means not called from menu,
               //so it doesn't show the Edit dialog with binarysetting control (On/Off).
               EditItemL( ListBox()->CurrentItemIndex(), EFalse );              }
            }

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜