Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pointerdown, pointerup events support #10

Open
Inversion-des opened this issue Feb 8, 2016 · 0 comments
Open

pointerdown, pointerup events support #10

Inversion-des opened this issue Feb 8, 2016 · 0 comments

Comments

@Inversion-des
Copy link

Hi!

When I tried to make a trigger for the tap event (for Ractive on-tap with ractive-events-tap plugin):

$.fn.r_trigger = (event_name, opt)->
    el = @[0]
    return if !el
    switch event_name
        when 'tap'
            if win.navigator.pointerEnabled
                simulant.fire(el, 'pointerdown', opt)
                simulant.fire(el, 'pointerup', opt)
            else if win.navigator.msPointerEnabled
                simulant.fire(el, 'MSPointerDown', opt)
                simulant.fire(el, 'MSPointerUp', opt)
            else
                simulant.fire(el, 'mousedown', opt)
                simulant.fire(el, 'click', opt)
        else
            simulant.fire(el, event_name, opt)
    @

I encountered a problem that Simulant fails to fire some events in the legacy mode.
So I had to add 4 events pointerdown pointerup MSPointerDown MSPointerUp to the the eventTypesByGroup.Event

I'm not sure if it is the best way to resolve the problem, so I didn't do a pull request.

Thanks for the lib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant