Results 1 to 8 of 8
  1.    #1  
    Does this method work for any of you guys?

    I try:

    Mojo.Char.isEnterKey(event.charCode) and I never get 'true'.

    This is present in the Palm calculator app and it doesn't even seem to work in that app either (enter key is supposed to function as = key).

    Anyone who got it to work?
    My shiny new TouchPad apps: Scientific RPN Calculator HD - Screamager HD
  2. #2  
    I tried to get it to work for a while, with never any luck.
  3.    #3  
    Ok I thought it was me. Thanks! Must be a global bug then, especially since it doesn't work in Palm's own code either.
    My shiny new TouchPad apps: Scientific RPN Calculator HD - Screamager HD
  4. computrav's Avatar
    Posts
    15 Posts
    Global Posts
    26 Global Posts
    #4  
    This is also used in the Messaging app -- it's what causes messages to be sent when you press Enter, and it works there.

    See related hack to change this behavior here at the webos-internals site (forum won't let me post a link, sorry)
  5. #5  
    Try:

    Mojo.Char.isEnterKey(event.keyCode)
  6. #6  
    assume you did something like:

    this.controller.listen(this.InputElement, Mojo.Event.propertyChange, this.execute.bindAsEventListener(this));

    Then, you create an event function like:

    MyAssistant.prototype.execute = function(event){
    ... if(Mojo.Char.isEnterKey(event.originalEvent.keyCode)) {
    ...... do somthing since we got an enter
    ... } else {
    ...... do something else with the char since it was not an enter...
    ... }
    }
    Last edited by rboatright; 08/13/2009 at 04:11 PM. Reason: k
  7. #7  
    It's not a problem with having incorrect code. You can do it 100% correct and your event will get all key codes except 13. It's never passed to the widgets.

    You have to listen for keydown on the document.

    Forums webOS • View topic - Mojo.Char.isEnterKey
  8.    #8  
    That's what I found out later as well oil. Working fine now. Sorry I forgot to update this thread.
    My shiny new TouchPad apps: Scientific RPN Calculator HD - Screamager HD

Posting Permissions