Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Controlling the softkeys in Symbian Web Runtime

From Wiki
Jump to: navigation, search

This code snippet demonstrates how to show and hide the softkey pane, and how to change the right softkey caption and handler.

Article Metadata
Code ExampleTested with
Devices(s): Nokia 5800 XpressMusic, Nokia 6220 Classic
Platform(s): S60 5th Edition, S60 3rd Edition FP2
S60 5th Edition
S60 3rd Edition FP2
Keywords: menu.setRightSoftkeyLabel(), menu.showSoftkeys(), menu.hideSoftkeys()
Created: dekuykin (26 Feb 2009)
Last edited: hamishwillee (04 Oct 2012)


Source file: Relevant HTML components

<input type="button" id="show" value="ENABLE SOFTKEYS" onclick="show();" />
<input type="button" id="hide" value="DISABLE SOFTKEYS" onclick="hide();" />
<p>Set Right Softkey Action</p>
<input type="radio" name="softkeySettings" id="softkeyExit"
onclick="setExit();" />
<label for="softkeyExit">Exit</label>
<input type="radio" name="softkeySettings" id="softkeyAlert"
onclick="setAlert();" />
<label for="softkeyAlert">Alert</label>


* Shows the softkeys.

function show() {;
* Hides the softkeys.

function hide() {;
* Sets the right softkey handler and label to default.

function setExit() {"", null);
* Sets the right softkey handler and label to custom.

function setAlert() {
// Call showAlert() when the softkey is pressed"Alert", showAlert);
* Shows an alert message.

function showAlert() {
alert("The right softkey was pressed!");


  • Clicking the ENABLE SOFTKEYS button makes the softkey pane visible.
  • Clicking the DISABLE SOFTKEYS button hides the softkey pane.
  • Checking the Exit radio button changes the right softkey to default handler and caption ("Exit").
  • Checking the Alert radio button changes the right softkey to custom handler and caption ("Alert").

Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful to developers. The version of the WRT stub application used as a template in this snippet is v1.1.

This page was last modified on 4 October 2012, at 05:56.
42 page views in the last 30 days.