Results 1 to 5 of 5
  1.    #1  
    How does the Mojo.Event.keypress work? Because the SDK isn't very helpful.
    Are there different variables for each key? Or is it just the ASCII code for each? If so what would the ASCII code for the 'orange key' be?

    I'm trying to set up something that will change when the space bar is pressed.
  2. #2  
    in the sdk, go to >API>key presses ? it's useless ?
  3. #3  
    Quote Originally Posted by tjmarkham3 View Post
    How does the Mojo.Event.keypress work? Because the SDK isn't very helpful.
    Are there different variables for each key? Or is it just the ASCII code for each? If so what would the ASCII code for the 'orange key' be?

    I'm trying to set up something that will change when the space bar is pressed.
    It's the Unicode (check wikipedia) value.
    What it does is send a keypress event down the commander chain for your app, so you could set up a listener and do something on the keypress event.
    I tried getting this to work with a textfield once, and had a discussion with Palm about it, and that's pretty much where I ended up. It's like sending an event to yourself.
    WOG Dev - WebOS Group http://www.WebOSGroup.com
    PMP Dev - http://www.PimpMyPre.com
    Apps: WOG O.S.K., WOG Card Keeper, WOG Glowstick, WOG Kid Protect, PreLoad, PimpMySounds
  4. #4  
    Quote Originally Posted by tjmarkham3 View Post
    How does the Mojo.Event.keypress work? Because the SDK isn't very helpful.
    Are there different variables for each key? Or is it just the ASCII code for each? If so what would the ASCII code for the 'orange key' be?

    I'm trying to set up something that will change when the space bar is pressed.

    in your event listener you get event sent as parameter. event.keyCode will give the unicode I believe. You can check out the mappings for different keys in /usr/palm/frameworks/mojo/submissions/200.47/javascripts/keycodes.jsjsjs

    Something like the space bar is in there and you can check the keyCode against Mojo.Char.space (I think that's it, but you'll see it in keycodes.jsjsjs).

    So in your event listener for keypress you can check if (event.keyCode === Mojo.Char.space)

    -Eric G

    WebOS Internals Developer.
    Follow me on Twitter for updates to my projects: | Virtual Keyboard | wIRC | SuperTux | AUPT | KeyBoss | freeTether |

    Donate
  5.    #5  
    Thanks guys, I actually figured it out a while ago by looking at the source code for the calculator app
    hit up that thanks button

Posting Permissions