Re: GWT Support for Touch Event

2019-09-11 Thread Velusamy Velu
Jens:

Earlier you said "Touch devices usually emulate classic click / mouse move 
events as well". I have seen the mouse event handlers handling TouchStart 
consistently, as you said. But the same is not true for TouchMove. I have 
code that has been working as expected in handling mouse events. But the 
same set of code work only for the TouchStart.

event.preventDefault() & event.stopPropagation() didn't make any difference.

I see the value in creating a sample project to isolate the error. Thanks 
for your suggestion, we will work on that.

--Velu

On Sunday, September 8, 2019 at 12:21:44 PM UTC-4, Jens wrote:
>
>
> So you are saying the browser fires a touchend event but the GWT event 
>> handler isn't called as a result?
>>
>
> or touchmove
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/e61ba3cc-8e5c-4750-a238-f48a712c3f95%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-11 Thread Velusamy Velu
Craig:

This seems to be an unyielding beast, at least for me.

I have added event.preventDefault() and event.stopPropagation() and tried. 
The major difference between your app and my app is the use of canvas vs 
SVG. I'm using SVG.

I do see TouchStart, TouchMove, & TouchEnd but inconsistently.

I'm stopping this effort for now and revisit later.

Thanks for your suggestions.

On Monday, September 9, 2019 at 10:07:15 PM UTC-4, Craig Mitchell wrote:
>
> Ah, sorry, yes. I was remembering.
>
> Maybe try calling preventDefault and/or stopPropagation on the event.
>
> On my app, all the events come through perfectly.  I do however, only have 
> a Canvas on the page.  No other HTML elements to mess with the events.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/812f0896-8fac-4d25-a877-fa4327316277%40googlegroups.com.


Re: Hammer GWT Support for Touch Event

2019-09-10 Thread Frank
I don't think so.
I would just copy the code into your own project.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/38f51d26-618d-48ae-830e-7b66f899dd90%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-09 Thread Craig Mitchell
Ah, sorry, yes. I was remembering.

Maybe try calling preventDefault and/or stopPropagation on the event.

On my app, all the events come through perfectly.  I do however, only have 
a Canvas on the page.  No other HTML elements to mess with the events.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/dd89ab9c-b391-4c03-96ef-c8832f3a3f66%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-09 Thread Velusamy Velu
Craig:

Tried your suggestion, apparently drawingPaper.*addDomHandler *and 
drawingPaper.*addHandler* are behaving identically. The first touch 
(equivalent to mouse button down), the first "touch move" (mouse move) and 
touch end (mouse button up) are working as expected. The subsequent touches 
and touch moves are unpredictable. It appears that once a touch event is 
handled (touch down or touch move or touch end) there appears to be a 
requirement to do a "cleanup". Though it's not clear what it is supposed to 
be. Any ideas? Please let me know.

Thank You
-Velu

On Monday, September 9, 2019 at 1:49:47 PM UTC-4, Velusamy Velu wrote:
>
> Craig:
>
> I appreciate your suggestion. Behind the scene I'm handling multiple 
> touches, though only one touch is being considered. The difference between 
> your approach and mine is drawingPaper.*addDomHandler *and drawingPaper.
> *addHandler*. I will give it a try and let you know.
>
> Thank You
> --v
>
> On Monday, September 9, 2019 at 4:40:38 AM UTC-4, Craig Mitchell wrote:
>>
>> I found this as well.  I think browser implementation of these old single 
>> touch events isn't great.  I switched to using the multi touch versions.  
>> Something like this:
>>
>> private HashMap touches;
>>
>> private void handleScreenTouches(JsArray newTouches, boolean 
>> touchDown) {
>>   // Update the touch collection
>>   for (int i=0; i> Touch touch = newTouches.get(i);
>> if (touch != null) {
>>   if (touchDown) {
>> touches.put(touch.getIdentifier(), touch);
>>   }
>>   else {
>> touches.remove(touch.getIdentifier());
>>   }
>> }
>>   }
>>
>>   // Look through the remaining touches
>>   for (Touch touch : touches.values()) {
>> ...
>>   }
>> }
>>
>> drawingPaper.addDomHandler(event -> {
>> handleScreenTouches(event.getChangedTouches(), true);
>> }, TouchStartEvent.getType()));
>>
>>
>> drawingPaper.addDomHandler(event -> {
>> handleScreenTouches(event.getChangedTouches(), true);
>> }, TouchMoveEvent.getType()));
>>
>>
>> drawingPaper.addDomHandler(event -> {
>> handleScreenTouches(event.getChangedTouches(), false);
>> }, TouchEndEvent.getType()));
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/86a08eab-51b0-47f5-ac6d-6120359e648a%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-09 Thread Velusamy Velu
Craig:

I appreciate your suggestion. Behind the scene I'm handling multiple 
touches, though only one touch is being considered. The difference between 
your approach and mine is drawingPaper.*addDomHandler *and drawingPaper.
*addHandler*. I will give it a try and let you know.

Thank You
--v

On Monday, September 9, 2019 at 4:40:38 AM UTC-4, Craig Mitchell wrote:
>
> I found this as well.  I think browser implementation of these old single 
> touch events isn't great.  I switched to using the multi touch versions.  
> Something like this:
>
> private HashMap touches;
>
> private void handleScreenTouches(JsArray newTouches, boolean 
> touchDown) {
>   // Update the touch collection
>   for (int i=0; i Touch touch = newTouches.get(i);
> if (touch != null) {
>   if (touchDown) {
> touches.put(touch.getIdentifier(), touch);
>   }
>   else {
> touches.remove(touch.getIdentifier());
>   }
> }
>   }
>
>   // Look through the remaining touches
>   for (Touch touch : touches.values()) {
> ...
>   }
> }
>
> drawingPaper.addDomHandler(event -> {
> handleScreenTouches(event.getChangedTouches(), true);
> }, TouchStartEvent.getType()));
>
>
> drawingPaper.addDomHandler(event -> {
> handleScreenTouches(event.getChangedTouches(), true);
> }, TouchMoveEvent.getType()));
>
>
> drawingPaper.addDomHandler(event -> {
> handleScreenTouches(event.getChangedTouches(), false);
> }, TouchEndEvent.getType()));
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/50e9d8ea-bc1d-4183-81f8-e8ff7b2cfcf4%40googlegroups.com.


Re: Hammer GWT Support for Touch Event

2019-09-09 Thread Velusamy Velu
Hi Frank:

I appreciate your suggestion. Is there a jar for it in the maven rep? 
Please let me know.

Thank You
--v

On Monday, September 9, 2019 at 4:12:45 AM UTC-4, Frank wrote:
>
> Try using the ahome wrapper instead of the geomajas wrapper: 
> https://github.com/ahome-it/ahome-hammer
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/2f7f6b26-e041-47ee-960d-52f0584374e0%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-09 Thread Craig Mitchell
I found this as well.  I think browser implementation of these old single 
touch events isn't great.  I switched to using the multi touch versions.  
Something like this:

private HashMap touches;

private void handleScreenTouches(JsArray newTouches, boolean 
touchDown) {
  // Update the touch collection
  for (int i=0; i {
handleScreenTouches(event.getChangedTouches(), true);
}, TouchStartEvent.getType()));


drawingPaper.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), true);
}, TouchMoveEvent.getType()));


drawingPaper.addDomHandler(event -> {
handleScreenTouches(event.getChangedTouches(), false);
}, TouchEndEvent.getType()));

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/a5816a19-68c1-48fe-886c-68f111915121%40googlegroups.com.


Re: Hammer GWT Support for Touch Event

2019-09-09 Thread Frank
Try using the ahome wrapper instead of the geomajas wrapper: 
https://github.com/ahome-it/ahome-hammer

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/543f24ff-e168-4c86-bfef-b401affd0068%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-08 Thread Jens


> So you are saying the browser fires a touchend event but the GWT event 
> handler isn't called as a result?
>

or touchmove

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/08d64a24-c70e-4b05-9473-c2889f384652%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-08 Thread Jens


> "Maybe you should log all events using an event preview handler to figure 
> out why your code does not work as expected." I did all these without any 
> success and coming to this forum only as a last resort for help.
>

So you are saying the browser fires a touchend event but the GWT event 
handler isn't called as a result?

The issue with help requests in the form of "something does not happen in 
my app" is that we don't have the app :) So technically it is easier for 
you to debug your app to figure out why the handler isn't called. If the 
browser did not generate a touchend event then you already have you answer. 
Or maybe you have called event.preventDefault() somewhere which causes some 
events not to fire. 

Maybe you can make a minimal example project that mimics your application 
code and shows the problem you have.

-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/21a8505d-6526-43de-b3bb-ade33da00aae%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-08 Thread Velusamy Velu
Jens:

I appreciate your feedback. "Touch devices usually emulate classic click / 
mouse move events as well" - I understood that but the touch move is not 
translated into a mouse move with the button down. That's the only reason I 
ventured into supporting touch events.

"so if you have handlers for both they might interfere each other and 
breaking code assumptions." - Yes, I'm aware of that. To solve it I have 
separate handlers which extract the position of the click/touch & current 
position when moving. Doing anything with those coordinates is a whole 
different task and handled by different methods.

"Maybe you should log all events using an event preview handler to figure 
out why your code does not work as expected." I did all these without any 
success and coming to this forum only as a last resort for help.

--v

On Sunday, September 8, 2019 at 11:39:36 AM UTC-4, Jens wrote:
>
> Touch devices usually emulate classic click / mouse move events as well, 
> so if you have handlers for both they might interfere each other and 
> breaking code assumptions.
>
> Other than that, GWT does not do any real magic when it comes to events. 
> Touch events are handled the same as click events or other browser events.
>
> Maybe you should log all events using an event preview handler to figure 
> out why your code does not work as expected.
>
> -- J.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/43bd20cf-a155-4e6e-9957-83d63979b4dd%40googlegroups.com.


Re: GWT Support for Touch Event

2019-09-08 Thread Jens
Touch devices usually emulate classic click / mouse move events as well, so 
if you have handlers for both they might interfere each other and breaking 
code assumptions.

Other than that, GWT does not do any real magic when it comes to events. 
Touch events are handled the same as click events or other browser events.

Maybe you should log all events using an event preview handler to figure 
out why your code does not work as expected.

-- J.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/b53f73fc-c2d9-4186-be49-8c96f2efa778%40googlegroups.com.


Hammer GWT Support for Touch Event

2019-09-07 Thread Velusamy Velu
This is a continuation of my post yesterday 
 on 
almost the same topic. Having failed to handle 
com.google.gwt.event.dom.client.TouchMove I attempted to use Hammer GWT. 
Pretty much this also failed me. I could see it handling 
org.geomajas.hammergwt.client.event.EventType.TAP, 
org.geomajas.hammergwt.client.event.EventType.SWIPE, 
org.geomajas.hammergwt.client.event.EventType.SWIPERIGHT, 
org.geomajas.hammergwt.client.event.EventType.SWIPERIGHT and 
occasionally org.geomajas.hammergwt.client.event.EventType.DOUBLETAP. So, 
I'm pretty much in the same soup as I was before. Here's the sample code.

import staticorg.geomajas.hammergwt.client.event.EventType.*;

HammerTime hammerTime = HammerGwt.create(drawingPaper);
HammerGwt.on(hammerTime, new HammerHandler() {

  @Override
  public void onHammerEvent(NativeHammerEvent event) {
EventType eventType = event.getType();
MaterialToast.fireToast(eventType.toString(), 5000);
  }
}, DOUBLETAP, DRAG, DRAGDOWN, DRAGEND, DRAGLEFT, DRAGRIGHT, DRAGSTART, 
DRAGUP, GESTURE, HOLD,
PINCH, PINCHIN, PINCHOUT, RELEASE, ROTATE, SWIPE, SWIPEDOWN, SWIPELEFT, 
SWIPERIGHT, SWIPEUP,
TAP, TOUCH, TRANSFORM, TRANSFORMEND, TRANSFORMSTART);

As in my earlier post I'm using browsers like Chrome, Firefox, Duck Duck 
Go, Bravo, Opera, and Opera Mini on my Pixel 2 and Samsung Galaxy Tab A.

Any suggestions would be very much appreciated.

Thank You

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/f76f6355-d342-4d8e-8699-83f5e16273eb%40googlegroups.com.


GWT Support for Touch Event

2019-09-06 Thread Velusamy Velu
I'm implementing an online drawing tool using GWT & HTML5. I have handled 
mouse events successfully and I'm venturing in to handling touch events to 
cover devices that only fire touch events. I have tried  
com.google.gwt.event.dom.client.Touch*Events. 

I do notice TouchStart, TouchMove, & TouchEnd events being fired. However, 
when these events utilized (start drawing, continue drawing, finish 
drawing; for e.g., a line) handling events become inconsistent. TouchStart 
is always handled well but the other two, TouchMove and TouchEnd aren't 
handled consistently. Given below is a segment of code.
drawingPaper.sinkEvents(Event.TOUCHEVENTS);

// Handle touch start
drawingPaper.addHandler(new TouchStartHandler() {
  @Override
  public void onTouchStart(TouchStartEvent event) {
startingPoint = PointerEventHelper.getUsableLocation(event, ...);
// no device specific code in the method below
handlePointerDownActionImpl(); /* Consistently getting called */
  }
}, TouchStartEvent.getType());

// Handle touch move
drawingPaper.addHandler(new TouchMoveHandler() {
  @Override
  public void onTouchMove(TouchMoveEvent event) {
currentLocation = PointerEventHelper.getUsableLocation(event, ...);
// no device specific code in the method below
handlePointerMoveActionImpl(); /* Call to this is inconsistent */
  }
}, TouchMoveEvent.getType());


I'm using browsers like Chrome, Firefox, Duck Duck Go, Bravo, Opera, and 
Opera Mini on my Pixel 2 and Samsung Galaxy Tab A.

Any suggestions would be very much appreciated.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/15c87eb4-acec-4c78-8870-406cdc63a5f9%40googlegroups.com.