Results 1 to 9 of 9
  1.    #1  
    I am working on an app that has Mojo.Event.tap and Mojo.Event.hold on the same scene.

    Whenever I do a hold on the scene it fires the hold event, but it also fires the tap event once I let go, even if I hold for 5 seconds.

    Here is the sequence of events:
    <press the screen>
    <hold for a second or so>
    <hold event fires>
    <hold three more seconds>
    <lift finger>
    <tap event fires>

    arg.

    How can I stop tap from firing from hold?
  2.    #2  
    Well I am hoping this is a hack, but here is what I did.

    On the Mojo.Event.hold event I stop listening for tap events.

    Then I set a timeout callback to re-enable listening for taps after 1 second.

    I tried reenabling taps when holdEnd fires, but that still caused tap to fire.
  3. #3  
    Create a scene-level boolean variable called ignoreTap, set it to false initially. On your hold handler, set it to true. Then in your tap handler, put something like

    Code:
    if (ignoreTap == true)
    {
    ignoreTap = false;
    return;
    } else {
    // handle tap
    }
    Treo 300 > Hitachi G1000 > PPC-6700 > PPC-6800 (Mogul) > PPC-6850 (Touch Pro) > Palm Pre & HTC EVO Optimus V
  4. #4  
    Quote Originally Posted by dallashigh View Post
    Create a scene-level boolean variable called ignoreTap, set it to false initially. On your hold handler, set it to true. Then in your tap handler, put something like

    Code:
    if (ignoreTap == true)
    {
    ignoreTap = false;
    return;
    } else {
    // handle tap
    }
    Good idea, but then when do you set the boolean back to False? If you do it in the holdEnd event, the tap still happens.

    You could set a timeout to set it back, but that is effectively the same work around used above.
  5. #5  
    we definitely should bring it to palm's attention that the TAP event should only occur when a down and up event occur within a VERY SMALL timeframe and within a VERY SMALL radius. it appears that tap occurs at the end of a flick (not small radius) and at the end of a hold (not small timeframe).

    i think it is an oversight in the mojo programming.
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  6. #6  
    you could forget about tap and use 'mousedown', 'mouseup'

    mousedown, set ignore false
    hold, set ignore true
    mouseup, do what you would do in tap

    -Eric G

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

    Donate
  7. #7  
    Quote Originally Posted by jkurtw View Post
    I am working on an app that has Mojo.Event.tap and Mojo.Event.hold on the same scene.

    Whenever I do a hold on the scene it fires the hold event, but it also fires the tap event once I let go, even if I hold for 5 seconds.

    Here is the sequence of events:
    <press the screen>
    <hold for a second or so>
    <hold event fires>
    <hold three more seconds>
    <lift finger>
    <tap event fires>

    arg.

    How can I stop tap from firing from hold?
    One way you can do it is to just use the "drag" instead of "hold." You will have to figure out the timing yourself by reading the time to see if he's doing a "hold" or "tap" but that should work.
    mobigamedepot.com
  8. #8  
    Quote Originally Posted by ClearWater View Post
    Good idea, but then when do you set the boolean back to False? If you do it in the holdEnd event, the tap still happens.

    You could set a timeout to set it back, but that is effectively the same work around used above.
    I'm not sure how much clearer I can make it. Inside the tap handler:

    Code:
    if (ignoreTap == true)
    {
    ignoreTap = false;
    return;
    }
    else
    {
    // actually do something
    }
    Treo 300 > Hitachi G1000 > PPC-6700 > PPC-6800 (Mogul) > PPC-6850 (Touch Pro) > Palm Pre & HTC EVO Optimus V
  9. #9  
    The Mojo tap stuff is pretty bad. It was easier to just write my own code using direct javascript. You can write for all the click, etc handlers just like if you were writing for Firefox/Safari, etc.

Posting Permissions