Mobile Phone Webpages - Navigation

Discussion in 'Web Design and Development' started by Craigy, Jun 30, 2009.

  1. Craigy macrumors 6502

    Joined:
    Jan 14, 2003
    Location:
    New Zealand
    #1
    Hi all,

    I am writing some webpages for a customer to access on a nokia phone.

    I have seen pages where the user can use the left and right phone buttons etc to choose links.. I've done a google search with not much joy - Does anyone know of any access key codes / mobile html specific mark up to detect key presses etc?

    Thanks
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    Knowledge of WRT is required.

    Visit this page and click on "Key event codes supported by WRT" to view the WRT codes mapped to Nokia buttons.

    Below is some Javascript that you can run and use with your Nokia to display the codes in real time as you press buttons and keys. These are the same codes reported in the listing, but never hurts to run it to be sure the listing is accurate. Also use the code to learn which native WRT functions to use for event code trapping. The rest is up to you.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
      <head>
        <script type="text/javascript">        
                
          /*
           * attach key listeners
           */
          document.onkeypress = keyPress;
          document.onkeyup = keyUp;
          document.onkeydown = keyDown;
     
          /*
           * disable cursor navigation - otherwise cursor 
           * key events are not received by keypress callbacks
           */
          widget.setNavigationEnabled(false);
                
          /*
           * show keyCode and charCode.
           */
          function keyPress(event) {
        document.getElementById('keypressField').innerHTML = event.keyCode + " / " + 
    event.charCode;
          }
          
          function keyDown(event) {
        document.getElementById('keydownField').innerHTML = event.keyCode + " / " + 
    event.charCode;
          }
                
          function keyUp(event) {
        document.getElementById('keyupField').innerHTML = event.keyCode + " / " +
    event.charCode;
          }
        </script>
            
        </head>
      <body>
        keyCode / charCode:
        
        <div>
          KeyPress: 
          <div id="keypressField"></div>
        </div>
        
        <div>
          Keydown: 
          <div id="keydownField"></div>
        </div>
        
        <div>
          Keyup: 
          <div id="keyupField"></div>
        </div>
     
      </body>
    </html>    
     
  3. Craigy thread starter macrumors 6502

    Joined:
    Jan 14, 2003
    Location:
    New Zealand

Share This Page