Hi all,
In an advanced datafield for an Edge (xx30 or xx40) device, I would like to inlude the OnTap() feature.
I have read all the forum postings about the OnTap feature, but I cannot get it working on the simulator.
I have created a datafield in Eclipse and it is working normally.
I have tried 2 different ways for addding the Ontap():
1) At the bottom of the ''AppNameView.mc" I added a second 'class' -> did not work
2) I created a new file "AppNameDelegate.mc" -> I get compilation errors when making intentional errors, so it gets compiled
import Toybox.System; import Toybox.WatchUi; import Toybox.Graphics; // was: class InputDelegate extends WatchUi.BehaviorDelegate { class mIslandDelegate extends WatchUi.BehaviorDelegate { function initialize() { BehaviorDelegate.initialize(); System.println("Initialized"); } function onTap(clickEvent) { System.println("Tap!"); System.println(clickEvent.getCoordinates()); // e.g. [36, 40] // System.println(clickEvent.getType()); // CLICK_TYPE_TAP = 0 return true; } }
No initialization took place and the tap is not noticed.
What I am doing wrong or missing?