SwapChainPanel.CreateCoreIndependentInputSource メソッド

定義

オーバーロード

CreateCoreIndependentInputSource(InputPointerSourceDeviceKinds)

deviceKinds パラメーターで指定された入力型を処理するコア入力オブジェクトを作成します。 このコア入力オブジェクトは、バックグラウンド スレッドで入力イベントを処理できます。

CreateCoreIndependentInputSource(CoreInputDeviceTypes)

deviceTypes パラメーターで指定された入力型を処理するコア入力オブジェクトを作成します。 このコア入力オブジェクトは、バックグラウンド スレッドで入力イベントを処理できます。

CreateCoreIndependentInputSource(InputPointerSourceDeviceKinds)

deviceKinds パラメーターで指定された入力型を処理するコア入力オブジェクトを作成します。 このコア入力オブジェクトは、バックグラウンド スレッドで入力イベントを処理できます。

public:
 virtual InputPointerSource ^ CreateCoreIndependentInputSource(InputPointerSourceDeviceKinds deviceKinds) = CreateCoreIndependentInputSource;
InputPointerSource CreateCoreIndependentInputSource(InputPointerSourceDeviceKinds const& deviceKinds);
public InputPointerSource CreateCoreIndependentInputSource(InputPointerSourceDeviceKinds deviceKinds);
function createCoreIndependentInputSource(deviceKinds)
Public Function CreateCoreIndependentInputSource (deviceKinds As InputPointerSourceDeviceKinds) As InputPointerSource

パラメーター

deviceKinds
InputPointerSourceDeviceKinds

列挙体の結合された値。

戻り値

相互運用のために入力サブシステムを表し、入力イベント接続ポイントに使用できる オブジェクト。

注釈

このメソッドを使用すると、 SwapChainPanel を含むアプリは、バックグラウンド スレッドで入力処理ロジックを意図的に提供しているため、XAML UI スレッドに依存しない入力とレンダリングを処理できます。 UI 以外のスレッドから CreateCoreIndependentInputSource を呼び出す必要があります。そうしないと、このメソッドは失敗します。

コア入力オブジェクトを作成し、 SwapChainPanel に関連付けるには、このメソッドを使用します。 正常に作成されると、 SwapChainPanel コンテンツにアクセスする指定したデバイスの種類のユーザー入力は、CreateCoreIndependentInputSource が呼び出されたスレッドにリダイレクトされます。 アプリでは、入力イベントに登録し、バックグラウンド スレッドでそれらのイベントを処理することで、この入力を処理できます。 CoreIndependentInputSource オブジェクトを介して入力メッセージを受信するには、アプリ コードで SwapChainPanel にスワップ チェーンを設定し、このスワップ チェーンから (Microsoft DirectX レベルで) 少なくとも 1 回レンダリングする必要があります。 これにより、ヒット テストを可能にするレンダリングが提供されます。

通常、イベント処理の一部として CoreDispatcher.ProcessEvents を使用します。 CoreIndependentInputSource.Dispatcher から CoreDispatcher 参照を取得します。 バックグラウンド スレッドの使用方法の詳細については、「 ThreadPool または Threading と非同期プログラミング」を参照してください。

このメソッドは複数回呼び出すことができます。 CreateCoreIndependentInputSource が呼び出されるたびに、前の CoreIndependentInputSource オブジェクトは SwapChainPanel との関連付けが解除されます。 つまり、一度にイベントを取得できる CoreIndependentInputSource オブジェクトは 1 つだけです。

CreateCoreIndependentInputSource の使用方法のコード例については、XAML SwapChainPanel DirectX 相互運用サンプルの一部であるクラス定義を参照してくださいDrawingPanel

DeviceKindsInputPointerSourceDeviceKinds.None として渡された場合、CreateCoreIndependentInputSource は null を返すことができます (ただし、CreateCoreIndependentInputSource を呼び出す一般的な方法ではありません)。

こちらもご覧ください

適用対象

CreateCoreIndependentInputSource(CoreInputDeviceTypes)

deviceTypes パラメーターで指定された入力型を処理するコア入力オブジェクトを作成します。 このコア入力オブジェクトは、バックグラウンド スレッドで入力イベントを処理できます。

public:
 virtual ExpIndependentPointerInputObserver ^ CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes) = CreateCoreIndependentInputSource;
ExpIndependentPointerInputObserver CreateCoreIndependentInputSource(CoreInputDeviceTypes const& deviceTypes);
public ExpIndependentPointerInputObserver CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes);
function createCoreIndependentInputSource(deviceTypes)
Public Function CreateCoreIndependentInputSource (deviceTypes As CoreInputDeviceTypes) As ExpIndependentPointerInputObserver

パラメーター

deviceTypes
CoreInputDeviceTypes

列挙体の結合された値。

戻り値

相互運用のために入力サブシステムを表し、入力イベント接続ポイントに使用できる オブジェクト。

注釈

このメソッドを使用すると、 SwapChainPanel を含むアプリは、バックグラウンド スレッドで入力処理ロジックを意図的に提供しているため、XAML UI スレッドに依存しない入力とレンダリングを処理できます。 UI 以外のスレッドから CreateCoreIndependentInputSource を呼び出す必要があります。そうしないと、このメソッドは失敗します。

コア入力オブジェクトを作成し、 SwapChainPanel に関連付けるには、このメソッドを使用します。 正常に作成されると、 SwapChainPanel コンテンツにアクセスする指定したデバイスの種類のユーザー入力は、CreateCoreIndependentInputSource が呼び出されたスレッドにリダイレクトされます。 アプリでは、入力イベントに登録し、バックグラウンド スレッドでそれらのイベントを処理することで、この入力を処理できます。 CoreIndependentInputSource オブジェクトを介して入力メッセージを受信するには、アプリ コードで SwapChainPanel にスワップ チェーンを設定し、このスワップ チェーンから (Microsoft DirectX レベルで) 少なくとも 1 回レンダリングする必要があります。 これにより、ヒット テストを可能にするレンダリングが提供されます。

通常、イベント処理の一部として CoreDispatcher.ProcessEvents を使用します。 CoreIndependentInputSource.Dispatcher から CoreDispatcher 参照を取得します。 バックグラウンド スレッドの使用方法の詳細については、「 ThreadPool または Threading と非同期プログラミング」を参照してください。

CreateCoreIndependentInputSource を複数回呼び出すことができます。 CreateCoreIndependentInputSource が呼び出されるたびに、前の CoreIndependentInputSource オブジェクトは SwapChainPanel との関連付けが解除されます。 つまり、一度にイベントを取得できる CoreIndependentInputSource オブジェクトは 1 つだけです。

CreateCoreIndependentInputSource の使用方法のコード例については、XAML SwapChainPanel DirectX 相互運用サンプルの一部であるクラス定義を参照してくださいDrawingPanel

DeviceTypes が CoreInputDeviceTypes.None として渡された場合、CreateCoreIndependentInputSource d は null を返すことができます (ただし、CreateCoreIndependentInputSource を呼び出す一般的な方法ではありません)。

こちらもご覧ください

適用対象