behaviorDelegate and Vivoactive4

Hi all,

I surely miss something but don't find what...

I try to understand what function of a behaviorDelegate is called when I push the upper button of a vivoactive4. So I overload all functions of inputDelegate and behaviorDelegate and put a println.
But when I start the simulator and push the button : nothing in the log !!... Same for holding pressure on screen.

class APICallDelegate extends WatchUi.BehaviorDelegate {

    function initialize() {
        BehaviorDelegate.initialize();
    }

    function onKey(evt) {
        var key = evt.getKey();
        System.println("Evt = " + evt + ", key=" + key);      // e.g. CLICK_TYPE_TAP = 0
        return true;
    }

    function onTap(clickEvent) {
		System.println("arg1");
		if (Application.Properties.getValue("TapLaunch") || selected_action == null) {
			self.onKey(new Toybox.WatchUi.KeyEvent(KEY_ENTER, PRESS_TYPE_ACTION));
		}
        return true;
    }

function onNextMode() {
		System.println("arg3");
		return false;
	}
function onNextPage() {
		System.println("arg4");
		return false;
	}
function onPreviousMode() {
		System.println("arg5");
		return false;
	}
function onPreviousPage() {
		System.println("arg6");
		return false;
	}
function onSelect() {
		System.println("arg7");
		return false;
	}

function onKeyPressed(keyEvent) {
		System.println("arg8");
		return false;
	}
function onKeyReleased(keyEvent) {
		System.println("arg9");
		return false;
	}
function onRelease(clickEvent) {
		System.println("arg10");
		return false;
	}
function onSelectable(selectableEvent) {
		System.println("arg11");
		return false;
	}
function onSwipe(swipeEvent) {
		System.println("arg12");
		return false;
	}


	function onHold(clickEvent) {
		System.println("arg20");
		self.onMenu();

        return true;
	}
	
	function onMenu() {
		System.println("arg21");
        ...

        return true;
    }

	function onBack() {
		System.println("arg22");
    	System.exit();
    }

  • I confirm that I click in the right place : take a look on the "debugexample" I posted, I can perfectly catch the upper button but only when I used a class passed throw a WatchUi.pushView().

    I think I will be going crazy ! Joy

    You said about "check for updates to your devices", it could be the source of the problem : 

  • Try again in a while, but I was able to check mine for an update just now.  You may want to try logging out of the sdk manager and logging back in.

  • Finally no, I was up to date for Vivoactive4. I try to delete and re-download, then re-load... No better...

    Here a video...

  • Did you comment out your onSelect/onTap code and try it then?  Just stay on the main view.

    If you take the input sample from the SDK and change it from a watch app to a widget (a simple change in the manifest) you can see the upper button works.

  • I comment out => not better.

    I also take the input sample from SDK. Without any change (Watch App), it show me KEY_ENTER. But when I change it to Widget, it doesn't show anything anymore. Fearful

    Note : Finally I have the issue with all touch devices... (Vivactive3, 4S, Venu, D2 ...) 

  • On Vivoactive3, the tap and the button are both interpreted.

    I had to learn this the hard way (from user complaints), but outside of an activity, the VA3's button takes you back to the watchface. So you can't use it in a widget :/.

    It's unfortunate (IMO), that the simulator doesn't model this kind of thing properly, but leads you to believe that the button can be detected by a widget.

    https://www8.garmin.com/manuals/webhelp/vivoactive3/EN-US/GUID-F76E3DE8-D6F8-4C7E-A361-3DBC4D8A7607.html

    Key

    Hold to turn on the device.

    Hold to view the controls menu, including device power.

    Press to return to the watch face from any screen, except during an activity.

    During an activity, press to pause the activity.

  • So a short press of the button doesn't do anything with the input sample (set as a widget) for any touch device?

    Restarting the sim doesn't help? 

    There is something odd with your setup.  You using eclipse with the latest plugin?  What java are you using?

    This has worked for me for years on many different apps and targets.  

  • FlowState, with this point of view, the behavior on the first view make sense... It doesn't say that this button is use to select...

    Same description for Vivoactive4.

    https://www8.garmin.com/manuals/webhelp/vivoactive4_4S/FR-FR/GUID-E8D90973-F651-4F66-9A08-A8858C2CB98E.html

    It's just confusing because in a sub view, it return KEY_ENTER ...

    I will stop to try to do something that doesn't appear to be in the mind of the usage of a widget ;o) My user will use a tap (even if he found that use a button make less manipulation errors), if he want to use button, he has just to buy a non touch device LaughingStuck out tongue winking eye

    Thanks to all, these discussion permit to better understand some things.

  • Jim, restart not help. Yes I'm up to date with eclispe and SDK. Honestly for Java I didn't check but as I remember I use the included one with eclipse. Anyway, regarding of FlowState last response I will give up. If I have some time to loose I will do a fresh install of tools and keep you in touch.

  • Well for VA4, the manual doesn't say that the action/start button (top right button) returns you to the watchface (since VA4 also has a Back button).

    So I think the VA3 is unique in the sense that it only has one button, and that button cannot be used in a widget. Every other touchscreen Garmin watch has at least two buttons.

    (At least I haven't heard any complaints from VA4 users of my stopwatch widget, which uses the start button the same way as non-touchscreen watches.)