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've filed the simulator issue I mentioned above as WERETECH-11000.

  • You are the boss !! You catched the issue into the mess of this thread. Sorry for that Sweat smile

    I switched to Glance View ON on FR945, then I saw the ON_KEY with Vivoactive4 Upper button, as Jim and Flow !!!

    I discussed with an user of my widget and can confirm you that in real life, the behavior is as the simulator when the Glance View is ON. IMO I think it's better like that (for my widget Smirk ), but I don't have the full overview...

    So to summarize, there are 3 bugs :

    - Vivoactive4, with glance view ON, normaly upper button should not be catched by initialDelegate, but it is and I can tell you it's the case in the reality.

    - Vivoactive3, with glance view ON, normaly the button should exit (doc say "return to the watch face"), it do KEY_ENTER, but in reality it return the watch face.

    - Vivoactive3, with glance view OFF, normaly the button should exit (doc say "return to the watch face"), it do nothing, but in reality it return to the watch face.

    One more time, thanks to the time you passed to understand this mess Sweat smile

  • Neither vivoactive3 or vivoactive4 device families support glance views, so the big bug here is that the behavior changes based on what the Glance View setting was last set to.

    I need to go back and double-check the device behavior, but I believe that the only inputs that should get passed to the base delegate of a widget are the ones that result in an ON_SELECT or ON_MENU behavior. Pressing the top-right button on a vivoactive4 should be ignored, as should a swipe left. Pressing the bottom-right button, swiping up, down, or right should exit the widget. On a physical device these actions would take you to the previous or next widget, or back to the watch face page.

    if the device does allow the enter button to go to the widget, that seems like a bug on the device, but my guess is that it would never be fixed and we should probably try to duplicate this in the sim.. which is a headache.