×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    1

    Getting keypad events in JavaScript

    Hi,

    I am trying to build a simple web game for Nokia mobiles where the user can click on "2", "4", "6" and "8" to move an object on the screen. In the web page I defined the onkeydown event handler and I am receiving the event but the keyCode and charCode and all the properties where I can get information about what the user clicked on is set to 0. I am using the emulator that comes with the S40 SDK. Can u please help?

    Thanks,
    Ahmed

  2. #2
    Registered User
    Join Date
    Jan 2011
    Posts
    9

    Re: Getting keypad events in JavaScript

    I can't help but can add that I am having key event issues as well. In my case, I'm using the s60 and want to capture key events while focused in a text field.The results I'm getting appear to be almost random. I think what is happening is that the first key's events aren't triggered until the second key is pressed. Even then, I too can't seem to get accurate keycodes.

    Is there perhaps documentation specific to dealing with javascript key events on devices using the numeric keypad for input?

  3. #3
    Nokia Developer Moderator
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Getting keypad events in JavaScript

    Quote Originally Posted by ahmed_aa@hotmail.com View Post
    Hi,

    I am trying to build a simple web game for Nokia mobiles where the user can click on "2", "4", "6" and "8" to move an object on the screen. In the web page I defined the onkeydown event handler and I am receiving the event but the keyCode and charCode and all the properties where I can get information about what the user clicked on is set to 0. I am using the emulator that comes with the S40 SDK. Can u please help?

    Thanks,
    Ahmed
    Hi Ahmed,

    You are on the right track, but unfortunately it seems that you cannot get the key codes by using the Series 40 web browser.
    If you wish you can try to run the test on http://www.quirksmode.org/js/keys.html (it is at the very bottom of the page)

    Could you consider doing the game as Symbian WRT widget? Then you can use Remote Device Access to test your app, if you don't have access to real device.

    Br,
    Ilkka

Similar Threads

  1. key events when keypad locked
    By juannoguera in forum Symbian User Interface
    Replies: 1
    Last Post: 2010-04-13, 20:17
  2. Keypad Events
    By alhad41 in forum Symbian
    Replies: 8
    Last Post: 2009-08-11, 14:47
  3. S60 Javascript Events
    By Akdor 1154 in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2009-07-24, 11:14
  4. Locked keypad and MMsvEntryObserver events
    By suckho in forum Symbian
    Replies: 3
    Last Post: 2003-05-21, 11:46
  5. Keypad events reporting over Bluetooth
    By fafou in forum Bluetooth Technology
    Replies: 0
    Last Post: 2002-06-06, 08:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •