IDirectManipulationRegion::AddMotion method

[This documentation is preliminary and is subject to change.]

Applies to: desktop apps only

Adds a motion to the direct manipulation region.

Syntax

HRESULT AddMotion(
  [in, unique]  IDirectManipulationMotion *motion
);

Parameters

  • motion [in]
    The direct manipulation motion to attach to the region.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

This method adds motion output to a region. This defines how a specific manipulation axis will respond to input. A motion can be added to the region at any time.

Examples

The following example shows how to create a motion and add it to a region.

IDirectManipulationRegion *pRegion = nullptr;
IDirectManipulationManager *pManager = ...;

if (SUCCEEDED(pManager->CreateRegion(IID_PPV_ARGS(&pRegion)))
{
    IDirectManipulationMotion *pMotionX = nullptr;
    if (SUCCEEDED(pManager->CreateMotion(1.0, 0.0, 
                  DIRECTMANIPULATION_INPUT_PANX, 
                  IID_PPV_ARGS(&pMotionX))))
    {
        hr = pRegion->AddMotion(pMotionX);
    }
}

Requirements

Minimum supported client

Windows Developer Preview

Minimum supported server

Windows Server Developer Preview

IDL

DirectManipulation.idl

See also

IDirectManipulationRegion

 

 

Build date: 12/12/2011