다음을 통해 공유


RadialControllerIndependentInputSource 클래스

정의

앱이 백그라운드 스레드에서 방사형 컨트롤러 입력을 처리할 수 있도록 합니다.

public ref class RadialControllerIndependentInputSource sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RadialControllerIndependentInputSource final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RadialControllerIndependentInputSource
Public NotInheritable Class RadialControllerIndependentInputSource
상속
Object Platform::Object IInspectable RadialControllerIndependentInputSource
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 Creators Update (10.0.15063.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v4.0에서 도입되었습니다.)

예제

여기서는 전용 백그라운드 스레드에 DispatcherQueue 를 만든 다음, 백그라운드 스레드에 만들어지는 RadialControllerInpdependentInputSource 개체를 초기화합니다.

public void CreateCoreIndependentInputSourceSample() 
{ 
    // Create a new thread, initialize DispatcherQueueController, 
    // and run a DispatcherQueue event loop on it. 
    _queueController =  
        DispatcherQueueController.CreateOnDedicatedThread(); 
    _queue = _queueController.DispatcherQueue;  

    // This is the first TryEnqueue() after creating the DispatcherQueue 
    // callback is guaranteed to be invoked first despite priority on the 
    // newly created thread. 
    bool isQueued = _queue.TryEnqueue( () => 
        {
            // The RadialControllerIndependentInputSource will raise events 
            // on the thread that created it.  
            radialInput = 
                RadialControllerIndependentInputSource.CreateForView(view); 
            radialInput.Controller.ButtonClicked += OnButtonClicked; 
            radialInput.Controller.ButtonHeld += OnButtonHeld; 
            radialInput.Controller.ButtonPressed += OnButtonPressed;  

            // Add RadialControllerMenuItems for this controller. 
            AddMenuItems(radialInput.Controller) 
        });         

    if (!isQueued) 
    { 
        // throw exception as this callback is enqueued. 
    } 

    // Enqueuing future tasks to this thread can be done using the DispatcherQueue 
    // property in RadialControllerIndependentInputSource.
    bool isTaskQueued = radialInput.DispatcherQueue.TryEnqueue( () => 
        { 
            // TODO. 
        }); 
}  

private DispatcherQueueController _queueController; 
private DispatcherQueue _queue; 
private RadialControllerIndependentInputSource radialInput; 

설명

DispatcherQueueController.CreateOnDedicatedThread를 호출하여 RadialControllerIndependentInputSource가 인스턴스화된 백그라운드 스레드에서 DispatcherQueue를 만듭니다. RadialControllerIndependentInputSource.DispatcherQueue 속성을 사용하여 이 DispatcherQueue에 액세스합니다.

버전 기록

Windows 버전 SDK 버전 추가된 값
1803 17134 DispatcherQueue

속성

Controller

휠 입력 장치 또는 Surface Dial과 같은 액세서리에 대한 참조를 가져옵니다.

Dispatcher

현재 보기와 연결된 이벤트 메시지 디스패처를 가져옵니다.

DispatcherQueue

RadialControllerIndependentInputSource와 연결된 DispatcherQueue를 가져옵니다.

메서드

CreateForView(CoreApplicationView)

실행 중인 앱의 현재 CoreWindow에 대한 RadialControllerIndependentInputSource의 instance 가져옵니다.

적용 대상