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:

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


Feedback Form (ExpandCollapse)

What do you think about this web page?






(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page