Touchkit long tap

Hello,

is there a event, that listen on, when I hold my finger longer than x seconds on a Component?
I saw something, that the normal doubleclick in the same as the long tap. But it doesnt work.

addLayoutClickListener(new LayoutClickListener() {

@Override
public void layoutClick(LayoutClickEvent event) {

if(event.isDoubleClick()) {
Notification.show("test");
}
}
});

AFAIK there is no special long tap listener. Some components (like Table) connect long tap to context menu.

Implementing this on client side with GWT is no magic, but requires some fine tuning with correct timeouts to make it really good UX vice. Unless your app is used on daily basis and your users can learn to find “hidden” feature and learn to use the long tap fluently, I’d first consider using some alternative solution. And this hint is not just for Vaadin apps.

cheers,
matti

Thank you for your advice!

But long tap is in my application the best way :confused:
Maybe someone else know how to do it.

Hi, I know how to do it, I did the long tap based context menu support into Table years ago :slight_smile:

The way to go really is to implement a custom component (a fresh component, extend a componet or create a vaadin component extension) with a client sider counter part. GWT has support for touch events and with Vaadin we also ship helpers to hook into pointer events in case you need to support MS touch devices as well.

If you end up creating something re-usable, I hope you can share your component in
the Directory
.

cheers,
matti

Thank you :slight_smile: I try my best and I will share it!