none
InteractionInfo and IsGripTarget RRS feed

  • Question

  • Im trying to program a WinForms application that allows control via the Kinect. I have created an IInteractionClient with a GetInteractionInfoAtLocation().  It always returns an InteractionInfo with the IsGripTarget = false;

    However, in my event handler for _InteractionFrameReady(), I still get InteractionHandPointer's with the HandEventTypes of Grip and GripRelease.

    Im not sure if that is expected, or if there is an issue with my code.  I assume that if I always set the IsGripTarget = false - that I would never get the Grip/GripRelease event types in the InteractionFrameReady event.

    I've got the IsPressTarget, PressAttractionPointX/Y working, but for some reason the Grip always allows me to Grip, even when the users Hand is over a control I don't want the user to be able to grip.

    Any thoughts?


    • Edited by kjwinkel Monday, October 14, 2013 1:48 PM
    Monday, October 14, 2013 12:22 AM

Answers

  • If you have some logic to enable it, you should leave that as well otherwise, leaving it set to false doesn't hurt. The values you provide are used in internal logic, so there may be unknown issues if you need it to be true and it is set to false.


    Carmine Sirignano - MSFT

    • Marked as answer by kjwinkel Tuesday, October 15, 2013 6:23 PM
    Tuesday, October 15, 2013 5:55 PM

All replies

  • You will still get Grip/GripReleased events in the callback. The grip recognizer logic will still process the users hand data. You should be validating the x,y position of the callback against the same logic you used to generate the InteractionInfo. This will ensure you are still checking to make sure the Interaction data is correct for the UI layer. At that point, you can throw out the grip events for that location. 

    Carmine Sirignano - MSFT

    Monday, October 14, 2013 9:47 PM
  • Thanks Carmine, so is it worth even doing the logic to see if its over a grip target in the GetInteractionInfoAtLocation?  I can see that the press attraction will cause it to center the hand as the user presses, but I'm not sure what benefit I get by setting the IsGripTarget. I don't think the logic is super expensive but doing it every frame twice (once in the IInteractionClient, and then again in the interactionframeready event) seems excessive if it doesn't do anything.

    Guess i am just curious what that setting does?

    Thanks!

    Monday, October 14, 2013 10:26 PM
  • If you have some logic to enable it, you should leave that as well otherwise, leaving it set to false doesn't hurt. The values you provide are used in internal logic, so there may be unknown issues if you need it to be true and it is set to false.


    Carmine Sirignano - MSFT

    • Marked as answer by kjwinkel Tuesday, October 15, 2013 6:23 PM
    Tuesday, October 15, 2013 5:55 PM