gwtquery icon indicating copy to clipboard operation
gwtquery copied to clipboard

How to bind Touch Events with GWTQuery?

Open confile opened this issue 11 years ago • 11 comments

To bind events like click with GQuery you can do something like:

@UiField
Element myButton;

... 

$(myButton).on("click", new Function() {
  @Override
  public void f() {
    // event is triggered
  }
}

What I need is support for touch events like Tap as it was implemented in MGWT. In MGWT you can use a TouchPanel to get a tap event like this:

@UiField
TouchPanel panel;

...

panel.addTapHandler(...);

Is there a way to bind a tap event with GQuery as it is done for the TouchPanel?

confile avatar Dec 12 '14 23:12 confile

I'm not sure if it will work but, GQuery uses browser native events. Tap event is "tap" and you should be able to bind on it.

christiangoudreau avatar Dec 13 '14 19:12 christiangoudreau

@christiangoudreau is "tap" without the 300ms delay?

confile avatar Dec 13 '14 19:12 confile

Okay, it seems like if "tap" isn't a native event. +1 for GQuery-Mobile then! :D

christiangoudreau avatar Dec 13 '14 19:12 christiangoudreau

@christiangoudreau Could you please post a link of GQuery-Mobile? Or is it still a dream? :-)

confile avatar Dec 13 '14 19:12 confile

Not a dream, but a requested feature that we should definitely work on!

christiangoudreau avatar Dec 13 '14 19:12 christiangoudreau

That would be great. Is there some workaround for the moment?

confile avatar Dec 13 '14 19:12 confile

You could probably look at gesture events instead: http://www.html5rocks.com/en/mobile/touch/#toc-events

Touch events is probably what you're looking for (touch start, touch ends and starting a timer on touch start of 300ms, stoping it if you reach 300ms or on touch end)

christiangoudreau avatar Dec 13 '14 20:12 christiangoudreau

Im working on a gestures plugin for gquery I'll post about it when release it

On Sat, Dec 13, 2014, 9:21 PM christiangoudreau [email protected] wrote:

You could probably look at gesture events instead: http://www.html5rocks.com/en/mobile/touch/#toc-events

Touch events is probably what you're looking for (touch start, touch ends and starting a timer on touch start of 300ms, stoping it if you reach 300ms or on touch end)

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/gwtquery/issues/318#issuecomment-66889826.

manolo avatar Dec 13 '14 22:12 manolo

@manolo When will you release it?

confile avatar Dec 13 '14 22:12 confile

Before gwt.create On Dec 13, 2014 11:16 PM, "Confile" [email protected] wrote:

@manolo https://github.com/manolo When will you release it?

— Reply to this email directly or view it on GitHub https://github.com/ArcBees/gwtquery/issues/318#issuecomment-66893709.

manolo avatar Dec 13 '14 22:12 manolo

So before Jan 2015 which means this month.

confile avatar Dec 13 '14 22:12 confile