확장 최소화

GestureRecognizer Class

제스처 및 조작 인식, 이벤트 수신기 및 설정을 제공합니다.

구문


var gestureRecognizer = new Windows.UI.Input.GestureRecognizer();

특성

[MarshalingBehavior(None)]
[Version(0x06020000)]

멤버

GestureRecognizer클래스에는 다음과 같은 형식의 멤버가 있습니다.

생성자

GestureRecognizer클래스에는 다음과 같은 생성자가 있습니다.

생성자Description
GestureRecognizer Initializes a new instance of a GestureRecognizer object.

 

이벤트

GestureRecognizer클래스에는 다음과 같은 이벤트가 있습니다.

이벤트Description
CrossSliding Occurs when a user performs a slide or swipe gesture (through a single touch contact) within a content area that supports panning along a single axis only. The gesture must occur in a direction that is perpendicular to this panning axis.
Dragging Occurs when a user performs a slide or swipe gesture with a mouse or pen/stylus (single contact).
Holding Occurs when a user performs a press and hold gesture (with a single touch, mouse, or pen/stylus contact).
ManipulationCompleted Occurs when the input points are lifted and all subsequent motion (translation, expansion, or rotation) through inertia has ended.
ManipulationInertiaStarting Occurs when all contact points are lifted during a manipulation and the velocity of the manipulation is significant enough to initiate inertia behavior (translation, expansion, or rotation continue after the input pointers are lifted).
ManipulationStarted Occurs when one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) has begun.
ManipulationUpdated Occurs after one or more input points have been initiated and subsequent motion (translation, expansion, or rotation) is under way.
RightTapped Occurs when the pointer input is interpreted as a right-tap gesture.
Tapped Occurs when the pointer input is interpreted as a tap gesture.

 

메서드

The GestureRecognizer 클래스 - 이러한 메서드가 있습니다. C#, Visual Basic 및 C++에서는 다음 위치의 메서드도 상속합니다. Object 클래스.

메서드Description
CanBeDoubleTap Identifies whether a tap can still be interpreted as the second tap of a double tap gesture.
CompleteGesture Causes the gesture recognizer to finalize an interaction.
ProcessDownEvent Processes pointer input and raises the GestureRecognizer events appropriate to a pointer down action for the gestures and manipulations specified by the GestureSettings property.
ProcessInertia Performs inertia calculations and raises the various inertia events.
ProcessMouseWheelEvent Processes pointer input and raises the GestureRecognizer events appropriate to a mouse wheel action for the gestures and manipulations specified by the GestureSettings property.
ProcessMoveEvents Processes pointer input and raises the GestureRecognizer events appropriate to a pointer move action for the gestures and manipulations specified by the GestureSettings property.
ProcessUpEvent Processes pointer input and raises the GestureRecognizer events appropriate to a pointer up action for the gestures and manipulations specified by the GestureSettings property.

 

속성

GestureRecognizer클래스 - 이러한 속성이 있습니다.

속성사용 권한Description

AutoProcessInertia

읽기/쓰기Gets or sets a value that indicates whether manipulations during inertia are generated automatically.

CrossSlideExact

읽기/쓰기Gets or sets a value that indicates whether the exact distance from initial contact to end of the cross-slide interaction is reported.By default, a small distance threshold is subtracted from the first position reported by the system for cross-slide interactions. If this flag is set, the distance threshold is not subtracted from the initial position.

CrossSlideHorizontally

읽기/쓰기Gets or sets a value that indicates whether the cross-slide axis is horizontal.

CrossSlideThresholds

읽기/쓰기Gets or sets values that indicate the distance thresholds for a CrossSliding interaction.

GestureSettings

읽기/쓰기Gets or sets a value that indicates the gesture and manipulation settings supported by an application.

InertiaExpansion

읽기/쓰기Gets or sets a value that indicates the relative change in size of an object from the start of inertia to the end of inertia (when resizing, or scaling, is complete).

InertiaExpansionDeceleration

읽기/쓰기Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the resizing, or expansion, manipulation is complete).

InertiaRotationAngle

읽기/쓰기Gets or sets a value that indicates the final angle of rotation of an object at the end of inertia (when the rotation manipulation is complete).

InertiaRotationDeceleration

읽기/쓰기Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the rotation manipulation is complete).

InertiaTranslationDeceleration

읽기/쓰기Gets or sets a value that indicates the rate of deceleration from the start of inertia to the end of inertia (when the translation manipulation is complete).

InertiaTranslationDisplacement

읽기/쓰기Gets or sets a value that indicates the relative change in the screen location of an object from the start of inertia to the end of inertia (when the translation manipulation is complete).

IsActive

읽기 전용Gets a value that indicates whether an interaction is being processed.

IsInertial

읽기 전용Gets a value that indicates whether a manipulation is still being processed during inertia (no input points are active).

ManipulationExact

읽기/쓰기Gets or sets a value that indicates whether the exact distance from initial contact to end of the interaction is reported.By default, a small distance threshold is subtracted from the first delta reported by the system. This distance threshold is intended to account for slight movements of the contact when processing a tap gesture. If this flag is set, the distance threshold is not subtracted from the first delta.

MouseWheelParameters

읽기 전용Gets a set of properties that are associated with the wheel button of a mouse device.

PivotCenter

읽기/쓰기Gets or sets the center point for a rotation interaction when single pointer input is detected.

PivotRadius

읽기/쓰기Gets or sets the radius, from the PivotCenter to the pointer input, for a rotation interaction when single pointer input is detected.

ShowGestureFeedback

읽기/쓰기Gets or sets a value that indicates whether visual feedback is displayed during an interaction.

 

Windows Phone 8

이 API는 구현되어 있지 않으므로 호출할 경우 예외가 throw됩니다. Windows Phone 런타임 API를 참조하십시오.

설명

참고  : 이 클래스는 Agile 클래스가 아닙니다. 즉, 이 클래스의 스레딩 모델 및 마샬링 동작을 고려해야 합니다. 자세한 내용은 스레딩 및 마샬링(C++/CX)다중 스레드 환경에서 Windows 런타임 개체 사용(.NET)을 참조하십시오.

예제

여기에서는 다양한 포인터 및 제스처를 처리하기 위한 입력 이벤트 처리기의 컬렉션을 사용하여 GestureRecognizer 개체를 설정합니다.

Windows 런타임 이벤트를 수신 대기 및 처리하는 방법은 JavaScript에서 Windows 런타임 사용을 참조하십시오.

참고  이벤트 처리기의 GestureRecognizer 개체 대신 이벤트 개체의 target 또는 currentTarget 속성을 사용합니다.



// inputManager handles gesture recognition for this sample.
function inputManager(target) {
    // Initialize the gesture recognizer.
    var gr = new Windows.UI.Input.GestureRecognizer();

    // Turn off visual feedback for gestures.
    // Visual feedback for pointer input is still displayed. 
    gr.showGestureFeedback = false;

    // Configure gesture recognizer to process the following:
    // double tap               - start questions and timer.
    // tap                      - move to next question.
    // right tap                - show answer.
    // hold and hold with mouse - start clues.
    gr.gestureSettings =
        Windows.UI.Input.GestureSettings.tap |
        Windows.UI.Input.GestureSettings.doubleTap |
        Windows.UI.Input.GestureSettings.rightTap |
        Windows.UI.Input.GestureSettings.hold |
        Windows.UI.Input.GestureSettings.holdWithMouse;

    // Register event listeners for these gestures.
    gr.addEventListener('tapped', tappedHandler);
    gr.addEventListener("holding", holdingHandler);
    gr.addEventListener("righttapped", rightTappedHandler);

    // Register event listeners for DOM pointer events.
    // The event pointer(s) are passed to the gesture recognizer
    // for further processing.
    target.addEventListener('MSPointerDown', pointerDown, false);
    target.addEventListener('MSPointerMove', pointerMove, false);
    target.addEventListener('MSPointerUp', pointerUp, false);
    target.addEventListener("MSPointerOver", pointerOver, true);
    target.addEventListener("MSPointerOut", pointerOut, true);
}

// Handle the pointer move event.
// The holding gesture is routed through this event.
// If pointer move is not handled, holding will not fire.
function pointerMove(evt) {
   _eventLog.innerText += "pointer move || ";

   // Get intermediate PointerPoints
   var pps = evt.intermediatePoints;

   // Pass the array of PointerPoints to the gesture recognizer.
   gr.processMoveEvents(pps);
};

// The pointer move event must also be handled because the 
// holding gesture is routed through this event.
// If pointer move is not handled, holding will not fire.
// A holding event is fired approximately one second after 
// a pointer down if no subsequent movement is detected.
function holdingHandler(evt) {
    if (evt.holdingState == Windows.UI.Input.HoldingState.started) {
        _eventLog.innerText += "holding || ";
    } else if (evt.holdingState == Windows.UI.Input.HoldingState.completed) {
        _eventLog.innerText += "holding completed || ";
    } else {
        _eventLog.innerText += "holding canceled || ";
    }
}

더 이상 필요하지 않은 경우 이벤트 처리기를 제거하고 제스처 인식기를 null로 설정합니다.



gr.removeEventListener('MSPointerDown', pointerDown);
gr = null;


요구 사항

지원되는 최소 클라이언트

Windows 8 [Windows 스토어 앱만]

지원되는 최소 서버

Windows Server 2012 [Windows 스토어 앱만]

지원되는 최소 전화

Windows Phone 8[구현되지 않음, 설명 참조]

Namespace

Windows.UI.Input
Windows::UI::Input [C++]

Metadata

Windows.winmd

참고 항목

참조
Windows.UI.Input 클래스
Windows.Devices.Input
Windows.UI.Core
Windows.UI.Input
Windows.UI.Input.Inking
Windows.UI.Xaml.Input
개념
사용자 상호 작용에 응답
일반적인 사용자 조작에 대한 지침
Windows 스토어 앱 개발(JavaScript 및 HTML)
JavaScript에서 Windows 런타임 사용
터치 조작 방식 디자인
샘플(DOM)
HTML 스크롤, 이동 및 확대/축소 샘플
입력: DOM 포인터 이벤트 처리 샘플
입력: 인스턴스화할 수 있는 제스처 샘플
샘플(Windows 스토어 앱 API)
입력: 장치 기능 샘플
입력: 잉크 샘플
입력: 조작 및 제스처(JavaScript) 샘플
입력: 간단한 잉크 샘플
입력: Windows 8 제스처 샘플
입력: XAML 사용자 입력 이벤트 샘플
XAML 스크롤, 이동 및 확대/축소 샘플
샘플(DirectX)
DirectX 터치 입력 샘플
입력: 조작 및 제스처(C++) 샘플
입력: 터치 적중 테스트 샘플
샘플(Win32/데스크톱)
입력 소스 식별 샘플
터치 주입 샘플
Win32 터치 적중 테스트 샘플

 

 

표시:
© 2014 Microsoft