How can I find the correct position of the function key ?)

Source: Internet
Author: User

Device, software version: s60 3rd edition and FP1

Nokia E70, Nokia E90, Nokia n93, Nokia N95

    • Detailed description

Command button array (CBA) is generally located at the bottom of the s60 mobile phone screen. If the mobile phone supports horizontal screen and vertical screen switching, the position of the CBA is not fixed (depending on the screen ). After the control panel in s60 UI is correctly placed, it can be scaled.ProgramYou should know the correct position of the CBA key.

    • Solution

In some mobile phones (such as Nokia E70, Nokia E90, Nokia n93, and Nokia N95), function keys appear on the left or right of the screen in Landscape mode. If the program needs to adjust the UI (function key position) based on the orientation, you can use

 
Aknlayoututils: cbalocation ();

To obtain the CBA location.

We will get the following return values:

 
Enum takncbalocation
 
{
 
Eakncbalocationbottom, // landscape and portrait
 
Eakncbalocationright, // only landscape
 
Eakncbalocationleft // only landscape
 
};

When the CBA is located at the bottom of the screen, the OK/options key is always defined on the left, while the opposite cancel/back key is always defined on the right.

When the CBA key is at both ends of the screen, the left function key of most devices is always at the bottom, but there are also columns, such as Nokia E90, which is at the top.

Without an API, you can directly solve the function key sequence problem, but you can monitor the key position using the following method:

Tbool isoptionsbuttonontop ()
 
{
 
Ceikbuttongroupcontainer * CBA = ceikbuttongroupcontainer: Current ();
 
If (! CBA)
 
{
 
Return efalse;
 
}
 
 
 
// Assumes that CBA has options and Exit commands
 
Ccoecontrol * Options = CBA-> controlornull (eaknsoftkeyoptions );
 
Ccoecontrol * exit = CBA-> controlornull (eaknsoftkeyexit );
 
 
 
If (options & Exit)
 
{
 
If (options-> position (). Iy <exit-> position (). Iy)
 
{
 
Return etrue;
 
}
 
}
 
Return efalse;
 
}
Related wiki articles

no related wiki articles found

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.