Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

KeyboardDevice Class

Abstract class that represents a keyboard device.

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
public abstract class KeyboardDevice : InputDevice

The KeyboardDevice type exposes the following members.

  NameDescription
Protected methodKeyboardDeviceInitializes a new instance of the KeyboardDevice class.
Top
  NameDescription
Public propertyActiveSourceGets the PresentationSource that is reporting input for this device. (Overrides InputDevice.ActiveSource.)
Public propertyDefaultRestoreFocusModeGets or sets the behavior of Windows Presentation Foundation (WPF) when restoring focus.
Public propertyDispatcherGets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public propertyFocusedElementGets the element that has keyboard focus.
Public propertyModifiersGets the set of ModifierKeys which are currently pressed.
Public propertyTargetGets the specified IInputElement that input from this device is sent to. (Overrides InputDevice.Target.)
Top
  NameDescription
Public methodCheckAccessDetermines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public methodClearFocusClears focus.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodFocusSets keyboard focus on the specified IInputElement.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetKeyStatesGets the set of key states for the specified Key.
Protected methodGetKeyStatesFromSystemWhen overridden in a derived class, obtains the KeyStates for the specified Key.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsKeyDownDetermines whether the specified Key is in the down state.
Public methodIsKeyToggledDetermines whether the specified Key is in the toggled state.
Public methodIsKeyUpDetermines whether the specified Key is in the up state.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodVerifyAccessEnforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top

The KeyboardDevice supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

For keyboard related input, use the Keyboard class. The Keyboard class represents the keyboard to an application and provides methods, properties, and events that reflect the state of the keyboard.

The Keyboard class delegates to the appropriate KeyboardDevice.

Each InputDevice object represents one particular input device. For example, if there are two mice, there will be two InputDevice objects.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.