Some questions about the touch events


Adrian Brookbank

Hi David,

Can touch events be added to control options. I know we have mouse up and mouse down - but these don’t seem to work correctly.

I’m wanting to change opacity on mouse down and up of an object this is working fine on Chrome but when I port to Cordova into iOS device this doesn’t work as expected.

See this, might be a conflict in click / timings to mouse up and down.?

https://www.html5rocks.com/en/mobile/touchandmouse/

Thanks for your help,


DecSoft

Hello Adrian,

We already use FastClick to avoid certain "timing" issue between the tap and click on mobile browsers. If I am not wrong, your issue is not specifically related with that.

In principle, we no need touch events, because, at the end a "touchstart" event, for example, finally fire an "onclick" event, also in touch devices. Maybe you don't believe me, but, I have here now various "touch" events implemented in AB, and, after work on it, I am not sure if go ahead or not.

Adding these touch events can made the things more complex, and, I am not really sure if what you wanted amerited to include the touch events in AB. For example, the below code in an app's view Show event can do what you wanted for all the buttons in the view:

Believe me, Adrian, it's not a problem to add these touch events in AB, and, in fact, I already do it for the Push button control. However, I am not sure if go ahead and publish a new AB release with that events. Just because I think that that events can made somethings more complex than now.

Note that the above code, for example, don't prevent the Click event to be executed (this is one of the things that we must to think about), if you want to do that, you must use the "preventDefault" in the "startend" event, like in the below code:

The above code don't work in browsers who don't support the touch (in non touch devices, for example). If you want that the code works also in these browsers you must add the appropriate events, like in the below code:


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.