17. WCSS Access Key Extension
17.1. Specifying Keypad Shortcuts for Elements (-wap-accesskey Property)
Only one WCSS property, -wap-accesskey, is included in the access key extension. The -wap-accesskey property is used to specify a keypad shortcut for an XHTML MP element. Valid property values are *, #, 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Here are some WAP CSS examples:
a.wcss_class_1 {-wap-accesskey: 1}
input.wcss_class_1 {-wap-accesskey: 4}
a.wcss_class_2 {-wap-accesskey: *}
input.wcss_class_2 {-wap-accesskey: #}
Note: Specifying directly the * and # characters to a property actually violates the CSS2 (and thus WAP CSS) syntax. To follow the CSS2 syntax, you have to use Unicode escape sequences instead. The Unicode escape sequences of * and # are \2a and \23 respectively. Examples: "-wap-accesskey: \2a", "-wap-accesskey: \23". However, in practice, some WAP browsers (e.g. some Sony Ericsson WAP browsers) require the form "-wap-accesskey: \2a" and "-wap-accesskey: \23", while some others (e.g. Openwave Mobile Browser 6.2.2) require the form "-wap-accesskey: *" and "-wap-accesskey: #".
If you read our XHTML MP tutorial, you will remember that some XHTML MP tags such as <a> and <input> contain the accesskey attribute that can also help you define a shortcut key in mobile phone browsers. You can achieve the same outcome by using either the -wap-accesskey property or the accesskey attribute. If the -wap-accesskey property is applied to an XHTML MP tag of which the accesskey attribute has been specified, the -wap-accesskey property value will override the accesskey attribute value.
In XHTML MP, only four elements (<a>, <input>, <label> and <textarea>) contain the accesskey attribute. If you apply the -wap-accesskey style to any element other than these four, there will be no effect when the keypad shortcut is pressed. For example, let's say you specify the WCSS style statement "p {-wap-accesskey: 1}" in a cascading style sheet. Nothing will happen if you press the "1" key of the keypad.
Previous Page | Page 25 of 39 | Next Page |
- 1. WCSS (WAP CSS) Introduction
- 2. Wireless CSS and Wireless Profile CSS
- 3. Advantages of Using WAP CSS Style Sheets on Mobile Internet Sites
- 4. Disadvantages of Using WAP CSS Style Sheets on Mobile Internet Sites
- 5. Syntax Rules of WCSS
- 6. Comments in WCSS
- 7. How to Apply WCSS Styles to an XHTML MP Document
- 8. Different Types of Selectors
- 9. Div and Span Element of XHTML MP
- 10. Cascading Rules for Handling Multiple Groups of WCSS Styles Applied to the Same Element
- 11. Common Types of Property Value
- 12. WCSS Font and Text Properties
- 13. WCSS List Properties
- 14. WCSS Color Properties
- 15. WCSS Border Properties
- 16. WAP Specific Extensions to CSS
- 17. WCSS Access Key Extension
- 18. WCSS Input Extension
- 19. WCSS Marquee Extension
- 20. Matching WCSS Cascading Style Sheets to Different User Agents