KeyboardDevice KeyboardDevice KeyboardDevice KeyboardDevice Class


Abstract class that represents a keyboard device.

public ref class KeyboardDevice abstract : System::Windows::Input::InputDevice
public abstract class KeyboardDevice : System.Windows.Input.InputDevice
type KeyboardDevice = class
    inherit InputDevice
Public MustInherit Class KeyboardDevice
Inherits InputDevice


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.


KeyboardDevice(InputManager) KeyboardDevice(InputManager) KeyboardDevice(InputManager) KeyboardDevice(InputManager)

Initializes a new instance of the KeyboardDevice class.


ActiveSource ActiveSource ActiveSource ActiveSource

Gets the PresentationSource that is reporting input for this device.

DefaultRestoreFocusMode DefaultRestoreFocusMode DefaultRestoreFocusMode DefaultRestoreFocusMode

Gets or sets the behavior of Windows Presentation Foundation (WPF) when restoring focus.

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the Dispatcher this DispatcherObject is associated with.

(Inherited from DispatcherObject)
FocusedElement FocusedElement FocusedElement FocusedElement

Gets the element that has keyboard focus.

Modifiers Modifiers Modifiers Modifiers

Gets the set of ModifierKeys which are currently pressed.

Target Target Target Target

Gets the specified IInputElement that input from this device is sent to.


CheckAccess() CheckAccess() CheckAccess() CheckAccess()

Determines whether the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)
ClearFocus() ClearFocus() ClearFocus() ClearFocus()

Clears focus.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Focus(IInputElement) Focus(IInputElement) Focus(IInputElement) Focus(IInputElement)

Sets keyboard focus on the specified IInputElement.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetKeyStates(Key) GetKeyStates(Key) GetKeyStates(Key) GetKeyStates(Key)

Gets the set of key states for the specified Key.

GetKeyStatesFromSystem(Key) GetKeyStatesFromSystem(Key) GetKeyStatesFromSystem(Key) GetKeyStatesFromSystem(Key)

When overridden in a derived class, obtains the KeyStates for the specified Key.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
IsKeyDown(Key) IsKeyDown(Key) IsKeyDown(Key) IsKeyDown(Key)

Determines whether the specified Key is in the down state.

IsKeyToggled(Key) IsKeyToggled(Key) IsKeyToggled(Key) IsKeyToggled(Key)

Determines whether the specified Key is in the toggled state.

IsKeyUp(Key) IsKeyUp(Key) IsKeyUp(Key) IsKeyUp(Key)

Determines whether the specified Key is in the up state.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

Enforces that the calling thread has access to this DispatcherObject.

(Inherited from DispatcherObject)

Applies to

See also