InputManager.PreProcessInput 事件


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

 event System::Windows::Input::PreProcessInputEventHandler ^ PreProcessInput;
[add: System.Security.SecurityCritical]
[remove: System.Security.SecurityCritical]
public event System.Windows.Input.PreProcessInputEventHandler PreProcessInput;
member this.PreProcessInput : System.Windows.Input.PreProcessInputEventHandler 
Public Custom Event PreProcessInput As PreProcessInputEventHandler 


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

附加至 PreProcessInput 的處理常式會以相反順序叫用,以便在系統中的處理常式之前叫用使用者加入的處理常式。The handlers attached to PreProcessInput are invoked in reverse order so that handlers added by the users are invoked before handlers in the system.

在傳遞至 PreProcessInputEventHandlerPreProcessInputEventArgs 上呼叫 Cancel,將會取消處理輸入。Calling Cancel on the PreProcessInputEventArgs passed to the PreProcessInputEventHandler will cancel the processing of the input.

輸入會在下列階段的 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.


用於加入或移除事件處理常式。for adding or removing an event handler. 相關聯的列舉: UnrestrictedAssociated enumerations: Unrestricted