Disable touch programmatically

I notice that some Garmin Apps on the F7/Epix Gen2 range display the ability to turn off the touch screen:

Is that functionality available in the Toybox API?

Top Replies

All Replies

  • I understand your confusion. It seems you're conflating native apps and Connect IQ apps with activities. Generally, native apps, like Walk, Run, etc., are designed specifically for activity recording. There are some exceptions, like the Applied Ballistics solver and Jumpmaster. which also appear in the app list but aren't intended to record activity data. (These are special native apps only available on certain devices, like tactix.)

    Connect IQ apps are also included in this apps list, of course, and may or may not be designed to record activity data. Hypothetically, you could build a Connect IQ watch app that just displays a string on the screen and that's it. :) A good example of a third-party app that does not record activity data is SkyWatch.

    However, a significant number of Connect IQ apps are designed to record activity data, which means they make use of the ActivityRecording module and often the FitContributor module. I'm fairly sure your app uses one of both of these.

    So when we talk about an activity starting in the context of a Connect IQ app, that usually means the app's author has instantiated an ActivityRecording.session and called .start() on that session, which would begin recording activity Info to a FIT file.

    When the activity starts the user gets prompted with the touchscreen status, which can be left at the system default or individually configured in the activity settings.

    What sabeard mentions here about the touch screen being configured in the activity settings, it's talking about the settings in the native app. The product teams decided to make this option available in the native apps, but this capability is not available in Connect IQ. I think there's definitely a strong case for providing this capability, but right now it's not available. I'll request it as a new feature and see whether we can get it added in the future.

    I did find this tidbit about Epix (which probably applies to fenix 7 as well): To temporarily enable or disable the touchscreen, hold DOWN and START. This might be a handy tip for your users.

  • I think there's definitely a strong case for providing this capability, but right now it's not available. I'll request it as a new feature and see whether we can get it added in the future.

    Brandon, CIQ4.1 is still in beta.  Wink Normally we see a couple releases before going to GA.  So far we have only seen one release, so there are a couple more beta's to sort out the feature.  Fingers crossed

  • Thanks again for the clarification.

    It seems you're conflating native apps and Connect IQ apps with activities

    Actually whilst the conflation arose from @jim_m_58 and @sabeard, the confusion was all mine. Wink I think they were referring to native apps as activities. Activity recording has always been an intrinsic part of my app, but I have never considered my app an "activity". 

    The product teams decided to make this option available in the native apps, but this capability is not available in Connect IQ.

    I wonder what development environment is available to the developers of native apps?

    But anyway, I'm afraid that it'll be far too late for me to benefit from that future. I have to manage it now, by monitoring isTouchScreen and some creative use of Jungles. And with the Sim not accurately simulating that, it's a bit of a challenge. Fortunately I have a co-operative Epix2 owner who is stepping up to be an alpha tester.

  • Yes yes yes. I face the same issues.

    My app was not designed for touch capabilities, with the fenix 7 and the epix, touch works whitout my knowledge and the user experience is not good.

    Refactoring my app by using Garmin default components will take several monthes of work and many features will be less user friendly to use!

    I agree with raceQs, simulator is not reliable for touch events, it has lead to many bad reviews on one of my app, so it is a risk to develope without a real touchscreen devices.

    My app is a payment one and I want offer a good service but since I can t desactivate touch capabilities I can t support F7 and Epix.

    Today again a user email me "I want to buy a Fenix7, to you plan to support new devices?" I answer No, I don t have any solution for touch cababilities.

  • Ok I have a solution to disable touch capabilities.

    From your class which extends Ui.BehaviorDelegate (Hope you have only one), change from "extends Ui.BehaviorDelegate" to "extends Ui.InputDelegate", thus you will be able to manage touch events too.

    Then override like this;

    // onTap and onSwipe must return true to not call default behaviour, thus nothing id done during swipe or tap.Sunglasses

    function onTap(clickEvent) {
             //Sys.println("onTap ");
            return true;
        }
        
        function onSwipe(evt) {
             //Sys.println("onSwipe ");
            return true;
        }

    // then manage buttons with onKey, just  call the matching method

    function onKey(keyEvent) {
            // le button
            Sys.println("key event " + keyEvent.getKey());

    // ENTER/START
            if (keyEvent.getKey() == keyEvent.KEY_ENTER || keyEvent.getKey() == keyEvent.KEY_START) {
                return onSelect();
            }

    // BACK
            else if (keyEvent.getKey() == keyEvent.KEY_LAP || keyEvent.getKey() == keyEvent.KEY_ESC) {
                return onBack();
            }

    // UP
            else if (keyEvent.getKey() == keyEvent.KEY_UP) {
                return onPreviousPage();
            }

    // DOWN
            else if (keyEvent.getKey() == keyEvent.KEY_DOWN) {
                return onNextPage();
            }
            return false;
        }

    In simulator, all touch capabilities are disable.

    Hope it works in real.

  • Yes that works if you're only supporting button devices. In my case, the same app supports touch screen devices as well, so this approach wouldn't work.

    I have resolved it with an extensive use of Jungles aexcludeAnnotations and sourcePath, plus code to detect and inhibit operation when a hybrid device (both modes) is running with isTouchEnabled.

    It's taken three weeks and the purchase of a Fenix7 to develop and test (as the 4.0.7 Sim doesn't accurately implement the isTouchScreen from Settings> Toggle Touch Screen.

  • I understand your confusion. It seems you're conflating native apps and Connect IQ apps with activities. Generally, native apps, like Walk, Run, etc., are designed specifically for activity recording. There are some exceptions, like the Applied Ballistics solver and Jumpmaster. which also appear in the app list but aren't intended to record activity data. (These are special native apps only available on certain devices, like tactix.)

    Now that I have my very own Fenix 7, (a very impressive, if rather expensive piece of kit!)  I see that Garmin is using "Activities" in a very special way. In the System Menu, it offers the following options under the "Touch" option:

    "During Activity" (on/off)

    Now here, "Activity" has a very specific meaning when it comes to watch apps (I don't know about widgets, data fields etc). It is a Garmin native app which creates an activity file, and does not refer to Developer apps.

    I think there's definitely a strong case for providing this capability,

    Now that I have had a chance to play with my F7, I suspect that we are wrong about this, and that even Garmin devs don't have the ability to disable touch programmatically.

    The display "Touch Disabled" we're seeing on Activities is the result of the Touch Disabled During Activity feature described above. 

  • I have used only sourcePath, my "input listener" for vivoactive and venu are in a  directory, and the listener for fenix, forunners... is in another directory .... and according to the device the good class is loaded, this is not a problem.

    Generally speaking I have 1 sourcePath directory for  common features and 1 or more for device specificities

    ->  I undertand your position/angry, doing an app can take many times (more than 1700 hours for my main app, yes 1700 not 170) and it is a personal investment, more over unjustified bad reviewes are not easy to understand, not easy to understand that somebody prefer post a bad review than contact you!

    And I see your app is free.... and target a little market... respect, you have my supportClap

  • I'll request it as a new feature and see whether we can get it added in the future.

    Wanna know when.

  • Some time later this post seems to be still unresolved. Your solution is fine in simulator but will not work on watch sadly...

    Maybe someone manage to have it working in the meantime?