Keyboard Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Represents the keyboard device.


Namespace:  System.Windows.Input
Assembly:  System.Windows (in System.Windows.dll)

public static class Keyboard

The Keyboard type exposes the following members.

Public propertyStatic memberModifiersGets the set of ModifierKeys that are currently pressed.

Most scenarios involving the keyboard are addressed by writing handlers for the key events KeyUp and KeyDown. The Keyboard class is a utility class with only one property, Modifiers. The event data class for KeyUp and KeyDown events reports the primary pressed key corresponding to each raising of a key event. If you want to check whether any modifier keys are also in a pressed state, you can check the Keyboard.Modifiers value from within a mouse event handler.

You might also want to check the Keyboard.Modifiers value when handling mouse events, depending on your application's input design.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

© 2015 Microsoft