Event Args Class
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public ref class KeyEventArgs : System::Windows::Input::KeyboardEventArgs
public class KeyEventArgs : System.Windows.Input.KeyboardEventArgs
type KeyEventArgs = class inherit KeyboardEventArgs
Public Class KeyEventArgs Inherits KeyboardEventArgs
This event data class is used with the following attached events:
This event data class is also used with the following routed events on base elements. These routed events forward the previously listed attached events to make them more accessible to the general element model in WPF.
The attached events and the base element routed events share their event data, and the bubbling and tunneling versions of the routed events also share event data. This can affect the handled characteristics of the event as it travels the event route. For details, see Input Overview.
A key can be in both the up and toggled states or the down and toggled states. For this reason, determining whether a key is up or down is not as simple as checking the KeyStates value as a numeric value. Instead, you should check the value by treating it as a flag enumeration. Use an
AND comparison of the first bit. Alternatively, use the helper properties IsUp, IsDown, and IsToggled to determine whether a given key is up, down, or toggled.
|KeyEventArgs(KeyboardDevice, PresentationSource, Int32, Key)||
Initializes a new instance of the KeyEventArgs class.
Gets the key that is part of dead key composition to create a single combined character.
Gets the input device that initiated this event.(Inherited from InputEventArgs)
Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.(Inherited from RoutedEventArgs)
Gets the keyboard key referenced by the event, if the key will be processed by an Input Method Editor (IME).
Gets the input source that provided this input.
Gets a value that indicates whether the key referenced by the event is in the down state.
Gets a value that indicates whether the keyboard key referenced by the event is a repeated key.
Gets a value that indicates whether the key referenced by the event is in the toggled state.
Gets a value that indicates whether the key referenced by the event is in the up state.
Gets the keyboard key associated with the event.
Gets the keyboard device associated with the input event.(Inherited from KeyboardEventArgs)
Gets the state of the keyboard key associated with this event.
Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.(Inherited from RoutedEventArgs)
Gets or sets a reference to the object that raised the event.(Inherited from RoutedEventArgs)
Gets the keyboard key referenced by the event, if the key will be processed by the system.
Gets the time when this event occurred.(Inherited from InputEventArgs)
Determines whether the specified object is equal to the current object.(Inherited from Object)
Serves as the default hash function.(Inherited from Object)
Gets the Type of the current instance.(Inherited from Object)
Invokes event handlers in a type-specific way, which can increase event system efficiency.
Creates a shallow copy of the current Object.(Inherited from Object)
When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.(Inherited from RoutedEventArgs)
Returns a string that represents the current object.(Inherited from Object)