InputManager 類別

定義

管理 Windows Presentation Foundation (WPF) 中的所有輸入的系統。Manages all the input systems in Windows Presentation Foundation (WPF).

public ref class InputManager sealed : System::Windows::Threading::DispatcherObject
public sealed class InputManager : System.Windows.Threading.DispatcherObject
type InputManager = class
    inherit DispatcherObject
Public NotInheritable Class InputManager
Inherits DispatcherObject
繼承
InputManager

備註

類別負責協調中WPFWPF的所有輸入系統。 InputManagerThe InputManager class is responsible for coordinating all of the input systems in WPFWPF.

篩選器是接聽PreProcessInputPostProcessInput的任何程式碼。A filter is any code that listens to PreProcessInput or PostProcessInput. 篩選器可以修改輸入暫存區域。Filters can modify the input staging area.

「監視」是接聽PreNotifyInputPostNotifyInput的任何程式碼。A monitor is any code that listens to PreNotifyInput or PostNotifyInput. 監視器無法修改輸入暫存區域。Monitors cannot modify the input staging area.

InputManager控制輸入暫存區域。The InputManager controls the input staging area. 輸入臨時區域會處理輸入Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)事件。The input staging area processes input into Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) events.

在下列階段中WPFWPF ,會在中處理輸入:Input is processed in WPFWPF in the follow stages:

  1. 前置處理階段。Pre-process stage. 輸入管理員會引發PreProcessInput事件。The input manager raises the PreProcessInput event.

  2. 預先通知階段。Pre-notify stage. 輸入管理員會引發PreNotifyInput事件。The input manager raises the PreNotifyInput event.

  3. WPFWPF引發輸入事件或事件。The WPFWPF input event or events are raised.

  4. 通知後階段。Post-notify stage. 輸入管理員會引發PostNotifyInput事件。The input manager raises the PostNotifyInput event.

  5. 後置處理階段。Post-process stage. 輸入管理員會引發PostProcessInput事件。The input manager raises the PostProcessInput event.

屬性

Current

取得與目前執行緒相關的 InputManagerGets the InputManager associated with the current thread.

Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(繼承來源 DispatcherObject)
InputProviders

取得註冊到 InputProvidersInputManager 的集合。Gets a collection of InputProviders registered with the InputManager.

IsInMenuMode

取得值,這個值表示此 ComponentDispatcher 是否處於功能表模式。Gets a value that indicates whether this ComponentDispatcher is in menu mode.

MostRecentInputDevice

取得值,這個值表示與最近一個輸入事件相關的輸入裝置。Gets a value that represents the input device associated with the most recent input event.

PrimaryKeyboardDevice

取得主要鍵盤裝置。Gets the primary keyboard device.

PrimaryMouseDevice

取得主要滑鼠裝置。Gets the primary mouse device.

方法

CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
PopMenuMode(PresentationSource)

由元件呼叫來離開功能表模式。Called by components to leave menu mode.

ProcessInput(InputEventArgs)

同步處理指定的輸入。Processes the specified input synchronously.

PushMenuMode(PresentationSource)

由元件呼叫來進入功能表模式。Called by components to enter menu mode.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)

事件

EnterMenuMode

發生於控制項呼叫 PushMenuMode(PresentationSource) 方法而進入功能表模式時。Occurs when a control enters menu mode by calling the PushMenuMode(PresentationSource) method.

HitTestInvalidatedAsync

發生於點擊測試的結果可能已經變更時。Occurs when the result of a hit-test may have changed.

LeaveMenuMode

發生於控制項呼叫 PopMenuMode(PresentationSource) 方法而離開功能表模式時。Occurs when a control leaves menu mode by calling the PopMenuMode(PresentationSource) method.

PostNotifyInput

發生於 PreNotifyInput 處理常式完成輸入處理且對應的 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 事件已引發之後。Occurs after the PreNotifyInput handlers have finished processing the input and the corresponding Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) events have been raised.

PostProcessInput

發生於 PreNotifyInput 處理常式完成輸入處理之後。Occurs after the PreNotifyInput handlers have finished processing the input.

PreNotifyInput

如果沒有取消輸入,則發生於 PreProcessInput 處理常式完成輸入處理時。Occurs when the PreProcessInput handlers have finished processing the input, if the input was not canceled.

PreProcessInput

發生於 InputManager 開始處理輸入項目時。Occurs when the InputManager starts to process the input item.

適用於

另請參閱