locked
When App Bar is up, I get pointermove events, but not pointerdown and pointerup. Why?

    Question

  • When a JavaScript Win8 app has an app bar and it's active, I get weird limited pointer events.  No pointerdown, no pointerup, but I do get pointermove.

    If I open the app bar and then tap in the app's space above the app bar, I don't get the pointerdown associated with that click, but I do get a pointermove event for that single tap.

    This is inconvenient, because it means my custom tracking and highlighting code gets triggered, and it looks to the user like they can interact with elements, but they can't really, since down/up events don't get passed on.  

    Is this expected?  It doesn't make any sense, and it's annoying to work around.  Why would it work this way?

    The same thing doesn't seem to happen with an active Charms bar.

    As a test case, take the app bar JavaScript sample, and just add some quick event handling to default.js after the processAll() call:

    var p = WinJS.UI.processAll().
        then(function () {

            // new test code:
            window.addEventListener('pointermove', function () {
                console.log("pointer move");
            }, false);
            window.addEventListener('pointerdown', function () {
                console.log("pointer down");
            }, false);

    Bring up the app bar and tap in the app space (e.g. on one of the menu items in the top left) and notice you get logging for the move event only.

    Saturday, March 28, 2015 9:00 PM

All replies

  • Hi gostay,

    I've followed your steps, but reproduce failed, here are my steps:

    1) Download sample: https://code.msdn.microsoft.com/windowsapps/App-bar-sample-a57eeae9
    2) Adding event listener as below in the default.js file:

     var p = WinJS.UI.processAll().
                        then(function () {
                            // new test code:
                            window.addEventListener('pointermove', function () {
                                console.log("pointer move");
                            }, false);
                            window.addEventListener('pointerdown', function () {
                                console.log("pointer down");
                            }, false);
                            window.addEventListener('pointerup', function () {
                                console.log("pointer up");
                            }, false);
    
                            // Navigate to either the first scenario or to the last running scenario
                            // before suspension or termination.
                            var url = SdkSample.scenarios.getAt(0).url;
    ......

    Screenshot:

    You can try my steps on your side and compare to yours.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 30, 2015 11:18 AM
    Moderator
  • Franklin,

    Thanks for looking into this.  I downloaded a fresh copy of that sample, re-added that code, and I get the same results I got before.  yes pointermove, no pointerdown/up.

    The exact repro steps are:

    1 Launch the app from Visual Studio

    2 Swipe up from the bottom of the display to trigger the app bar (or hit win-Z)

    3 While the app bar is still showing, tap just once in the main display space of the app, e.g. the big black space or on one of the menu items on the left (e.g. the "AppBar control sample" title text in the upper left.)

    4 Check debug log for events.

    This happens with any of the first 4 sub-examples selected ("Create an AppBar", "Customize AppBar color", etc.).  I've noticed I get pointerup/down if I'm working with the 5th subexample, "Show and hide commands", which has a sticky app bar.  So, the odd behavior of passing pointermove through but not pointerup/down seems to be specific to non-sticky appbars.

    Screenshot:

    Windows 8.1, VS Express 2013

    Thanks.

    -- gostay

    Monday, March 30, 2015 6:56 PM
  • Hi gostay,

    By following your steps, it still worked well on my side.

    My Visual Studio version is VS2013 Ultimate, have you tried this on other machine to exclude environment issue?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 31, 2015 2:00 PM
    Moderator
  • Strange and interesting!

    I tried on 3 different setups.  Results consistently support what I'm describing, when I use touch.

    * Lenovo Helix, Windows 8.1, using touch:  I get only a pointermove event on the first tap with the app bar up.

    * Touch-screen laptop, Windows 8.1, using touch:  I get only pointermove events on the first tap with the app bar up.

    same system using mouse:  I get no event logging at all on the click with app bar up.  This is fine - at least it's consistent.

    * Windows 10 tech preview on a desktop PC, using a mouse:  No event logging on the click with the app bar up.

    Again, to be clear:  the app bar is open when I tap.  I'm opening the app bar and then tapping on the main space of the app, not in the app bar space.  And I'm not closing the app bar first.  I'm quite surprised you're seeing different results.

    Tuesday, March 31, 2015 9:39 PM
  • Hi gostay,

    >>the app bar is open when I tap.  I'm opening the app bar and then tapping on the main space of the app, not in the app bar space

    This is what I did

    >>I'm quite surprised you're seeing different results.

    I was using simulator to test this app, based on your description, I think I need to test on a laptop with touch-screen, will come back if have any updates.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 07, 2015 10:59 AM
    Moderator