This topic has not yet been rated - Rate this topic

InputManager Class

Manages all the input systems in Windows Presentation Foundation (WPF).

System.Object
  System.Windows.Threading.DispatcherObject
    System.Windows.Input.InputManager

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
public sealed class InputManager : DispatcherObject

The InputManager type exposes the following members.

  Name Description
Public property Static member Current Gets the InputManager associated with the current thread.
Public property Dispatcher Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property InputProviders Gets a collection of InputProviders registered with the InputManager.
Public property IsInMenuMode Gets a value that indicates whether this ComponentDispatcher is in menu mode.
Public property MostRecentInputDevice Gets a value that represents the input device associated with the most recent input event.
Public property PrimaryKeyboardDevice Gets the primary keyboard device.
Public property PrimaryMouseDevice Gets the primary mouse device.
Top
  Name Description
Public method CheckAccess Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method PopMenuMode Called by components to leave menu mode.
Public method ProcessInput Processes the specified input synchronously.
Public method PushMenuMode Called by components to enter menu mode.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method VerifyAccess Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
  Name Description
Public event EnterMenuMode Occurs when a control enters menu mode by calling the PushMenuMode method.
Public event HitTestInvalidatedAsync Occurs when the result of a hit-test may have changed.
Public event LeaveMenuMode Occurs when a control leaves menu mode by calling the PopMenuMode method.
Public event PostNotifyInput Occurs after the PreNotifyInput handlers have finished processing the input and the corresponding Windows Presentation Foundation (WPF) events have been raised. 
Public event PostProcessInput Occurs after the PreNotifyInput handlers have finished processing the input.
Public event PreNotifyInput Occurs when the PreProcessInput handlers have finished processing the input, if the input was not canceled.
Public event PreProcessInput Occurs when the InputManager starts to process the input item.
Top

The InputManager class is responsible for coordinating all of the input systems in WPF.

A filter is any code that listens to PreProcessInput or PostProcessInput. Filters can modify the input staging area.

A monitor is any code that listens to PreNotifyInput or PostNotifyInput. Monitors cannot modify the input staging area.

The InputManager controls the input staging area. The input staging area processes input into Windows Presentation Foundation (WPF) events.

Input is processed in WPF in the follow stages:

  1. Pre-process stage. The input manager raises the PreProcessInput event.

  2. Pre-notify stage. The input manager raises the PreNotifyInput event.

  3. The WPF input event or events are raised.

  4. Post-notify stage. The input manager raises the PostNotifyInput event.

  5. Post-process stage. The input manager raises the PostProcessInput event.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ