locked
How to get the current positions in SwapChainBackgroundPanel when the touch keyboard is showing?

    Question

  • Dear all, currently I've encountered an issue but have no idea how to solve it.

     

    In VS2012 create a project with Direct2D App(XAML), and we could see that SwapChainBackgroundPanel is used from DirectXPage.xaml.

     

    Scenario 1:

    1. Run the program;

    2. When we slide/swipe on the screen with one finger, we will see that the "Hello, DirectX!" is moved.

    3. Call out the touch keyboard and try to slide/swipe on the screen, and we will find that the whole Window is scrolled with your finger;

     

    Scenario 2:

    1. Run the program, but don't make any operation on the screen;

    2. Call out the touch keyboard and try to slide/swipe on the screen, and we will see that the "Hello, DirectX!" is moved with your finger;

     

    Per my debugging, scenario 1 could only trigger SwapChainBackgroundPanel::PointerPressed. However, PointerPressed, PointerMoved and PointerReleased are all triggered in scenario 2.


    My question are:

    1. Why the behavior of scenario 1 and 2 is so different?

    2. In scenario 1, if the window is scrolled up for some distance, I could get the current positions/coordinates. But they are relative to the whole screen. How could I get the coordinates of the current positions in the Window (It has been scrolled up for some distance)?

     

    It could also be reproduced in VS2013 with SwapChainPanel.

    Thanks.

     

    BTW: the steps to call out the touch keyboard from surface series devices or other Win8/Win8.1 devices:

    1. Swipe in from the right edge of the screen, and then tap Settings.
      (If you're using a mouse, point to the lower-right corner of the screen, move the mouse pointer up, and then click Settings.)

    2. Tap the Keyboard icon.

    3. Tap Touch keyboard and handwriting panel.

    Thanks.



    • Edited by B0L Saturday, December 14, 2013 2:26 AM
    Thursday, December 12, 2013 5:16 AM

Answers

  • It seems that I couldn't make it out in VS2012/Win8.


    But the good news is that there is a solution in VS2013/Win8.1 to make the whole Window not be scrolled with your finger even the touch keyboard is called out. We use the class CoreIndependentInputSource and create a WorkItemHandler to handle the input of Mouse/Touch/Pen, just the same shown in the page.

    Hope this would do some help for others.


    • Marked as answer by B0L Monday, January 13, 2014 7:29 AM
    • Edited by B0L Tuesday, January 14, 2014 12:29 AM
    Monday, January 13, 2014 7:29 AM

All replies

  • Does anybody here? Thanks.

    In iOS, there is a system API locationInView to return the info. But Metro seems doesn't provide the similar peer!

    Friday, December 13, 2013 1:31 AM
  • How to Call out the on-screen keyboard?
    Friday, December 13, 2013 3:10 AM
  • Oops! Sorry, I meant the touch keyboard.

    The steps to call out the touch keyboard from surface series devices or other Win8/Win8.1 devices:
    1. Swipe in from the right edge of the screen, and then tap Settings.
      (If you're using a mouse, point to the lower-right corner of the screen, move the mouse pointer up, and then click Settings.)

    2. Tap the Keyboard icon.

    3. Tap Touch keyboard and handwriting panel.

     

    Thanks

    Saturday, December 14, 2013 2:28 AM
  • It seems that I couldn't make it out in VS2012/Win8.


    But the good news is that there is a solution in VS2013/Win8.1 to make the whole Window not be scrolled with your finger even the touch keyboard is called out. We use the class CoreIndependentInputSource and create a WorkItemHandler to handle the input of Mouse/Touch/Pen, just the same shown in the page.

    Hope this would do some help for others.


    • Marked as answer by B0L Monday, January 13, 2014 7:29 AM
    • Edited by B0L Tuesday, January 14, 2014 12:29 AM
    Monday, January 13, 2014 7:29 AM