One problem is that I'm not getting an onKey event when pressing the start or lap buttons on the Edge 520 or 1000. (I don't have an 820 to test). The simulator does call onKey when these buttons are pressed. This problem has already been reported to Garmin.
The next issue is with the 520. To Start an activity on the Edge devices, you press the Start button which causes (is supposed to cause) an onKey event with the Key = KEY_START = 18. To Start an activity on all of the watches, you press the Enter button which returns an onKey event with KEY = KEY_ENTER = 4.
At first glance, this is no problem in my apps because I can start the activity when I see either KEY_ENTER, or KEY_START.
However, the Edge 520 has a bit of confusion. It has both a Start button and an Enter button. If I simply use an OR statement, then the app will start when the Enter button is pressed which might be unexpected behavior. Especially since a long hold on the Enter button is what brings up the Menu. You can get to the menu without triggering an Enter button key event if you are careful not to release too soon but it's not ideal.
The onSelect Behavior isn't a solution because it only responds to Enter key presses.
Of course its a straight forward solution to add something to the 520 resource file to identify it and then make the logic to start an activity to be
if (key == KEY_START || (key == KEY_ENTER && device != "edge")) {
activity.start()
}
This just seems inelegant for such a basic function as starting an activity. Is there a more elegant approach that I'm missing???
DOCUMENTATION UPDATE REQUEST - The onSelect behaviour is listed in the Toybox.html documentation under ToyBox>>WatchUI>>BehaviourDelegate, but its missing in the Behaviors section of the Programmer's Guide.