Any way to listen for input for a watch face?

Hi,

it seems there is no way to handle any input on a watch face. I tried to pass a BehaviorDelegate object as second array element in the "getInitialView" method but then I get the following error in the console:

Unexpected Type Error

I guess this is because input handling for watch faces is not allowed, am I right? If so, the question is why? at least listening to the "back" button makes completely sense, as there is no functionality bound to it when on the watch face. I would like to use this button to toggle information on the watch face itself.

Is there a way to achieve that?

Thanks!

Bye
  • No way to get input. Watchfaces can't receive input of any type - buttons, taps, swipes, etc. Watchfaces can't do a number of things like vibrate, play tones, etc. And without a background process, no comm, direct sensor access, etc. No timer except after onExitSleep() and before onEnterSleep(), etc.
  • No way to get input. Watchfaces can't receive input of any type - buttons, taps, swipes, etc. Watchfaces can't do a number of things like vibrate, play tones, etc. And without a background process, no comm, direct sensor access, etc. No timer except after onExitSleep() and before onEnterSleep(), etc.


    That is what I was thinking, thanks for the confirmation :)

    Bye
  • The API doc notes what app types things are supported with.
  • Many years later and things have changed. This now works. You can pass it as an argument. E.g.

    function getInitialView() as Array<Views or InputDelegates> ? {
            complicationFaceView = new ComplicationFaceView();
            return [complicationFaceView, new WatchDelegate()] as Array <Views or InputDelegates>;
        }
    class WatchDelegate extends Ui.WatchFaceDelegate {
      function initialize() {
        WatchFaceDelegate.initialize();
      }

      public function onPress(clickEvent) {
        // grab the [x,y] position of the clickEvent
        var co_ords = clickEvent.getCoordinates();
        Sys.println( "clickEvent x:" + co_ords[0] + ", y:" + co_ords[1]  );

        var heartRateComplicationId = new Id(Complications.COMPLICATION_TYPE_HEART_RATE);
        Complications.exitTo(heartRateComplicationId);
        return true;    
      }
    }
  • onPress is for complications and devices that support them.  A watch face delegate accepts no other input.  A watch face delegate can see 

    onPowerBudgetExceeded() if you spend too much time in onPartialUpdate().  It's been that way since onPartialUpdate() was introduced.
  • See the documentation: Toybox.WatchUi.WatchFaceDelegate (garmin.com)

    I've implemented it and it works in the simulator.

  • "Sine API Level 4.2.0".

    So only touch devices with complications