Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Craigy

macrumors 6502
Original poster
Jan 14, 2003
403
48
New Zealand
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
 
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>
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.