KeyEventArgs クラス
定義
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. これらのルーティングイベントは、前に示した添付イベントを転送して、のWPFWPF一般的な要素モデルによりアクセスできるようにします。These routed events forward the previously listed attached events to make them more accessible to the general element model in WPFWPF.
添付イベントと基本要素のルーティングイベントは、イベントデータを共有します。また、ルーティングイベントのバブルおよびトンネリングバージョンも、イベントデータを共有します。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. このため、キーが上または下にあるかどうかを判断することはKeyStates 、値を数値としてチェックするだけではありません。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. 最初のビットの比較を使用します。AND
Use an AND
comparison of the first bit. または、ヘルパープロパティIsUp IsDown、、およびをIsToggled使用して、特定のキーが稼働しているかどうかを判断します。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) |
KeyEventArgs クラスの新しいインスタンスを初期化します。Initializes a new instance of the KeyEventArgs class. |
プロパティ
DeadCharProcessedKey |
1 つの組み合わせ文字を作成するデッド キー構成の一部であるキーを取得します。Gets the key that is part of dead key composition to create a single combined character. |
Device |
このイベントを開始した入力デバイスを取得します。Gets the input device that initiated this event. (継承元 InputEventArgs) |
Handled |
ルーティング イベントがルートをたどる際のイベント処理の現在の状態を示す値を取得または設定します。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. (継承元 RoutedEventArgs) |
ImeProcessedKey |
キーが Input Method Editor (IME)Input Method Editor (IME) によって処理される場合、イベントで参照されるキーボード キーを取得します。Gets the keyboard key referenced by the event, if the key will be processed by an Input Method Editor (IME)Input Method Editor (IME). |
InputSource |
この入力を提供した入力ソースを取得します。Gets the input source that provided this input. |
IsDown |
イベントによって参照されるキーが押された状態かどうかを示す値を取得します。Gets a value that indicates whether the key referenced by the event is in the down state. |
IsRepeat |
イベントによって参照されるキーボード キーが繰り返されたキーかどうかを示す値を取得します。Gets a value that indicates whether the keyboard key referenced by the event is a repeated key. |
IsToggled |
イベントによって参照されるキーが切り替わった状態かどうかを示す値を取得します。Gets a value that indicates whether the key referenced by the event is in the toggled state. |
IsUp |
イベントによって参照されるキーが離された状態かどうかを示す値を取得します。Gets a value that indicates whether the key referenced by the event is in the up state. |
Key |
イベントに関連付けられているキーボード キーを取得します。Gets the keyboard key associated with the event. |
KeyboardDevice |
入力イベントに関連付けられたキーボード デバイスを取得します。Gets the keyboard device associated with the input event. (継承元 KeyboardEventArgs) |
KeyStates |
このイベントに関連付けられているキーボード キーの状態を取得します。Gets the state of the keyboard key associated with this event. |
OriginalSource |
親クラスによって Source が調整される前の、純粋なヒット テストで判断される元の報告ソースを取得します。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. (継承元 RoutedEventArgs) |
RoutedEvent |
この RoutedEventArgs インスタンスに関連付けられている RoutedEvent を取得または設定します。Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. (継承元 RoutedEventArgs) |
Source |
イベントを発生させたオブジェクトへの参照を取得または設定します。Gets or sets a reference to the object that raised the event. (継承元 RoutedEventArgs) |
SystemKey |
キーがシステムによって処理される場合、イベントで参照されるキーボード キーを取得します。Gets the keyboard key referenced by the event, if the key will be processed by the system. |
Timestamp |
このイベントが発生した時刻を取得します。Gets the time when this event occurred. (継承元 InputEventArgs) |
メソッド
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判定します。Determines whether the specified object is equal to the current object. (継承元 Object) |
GetHashCode() |
既定のハッシュ関数として機能します。Serves as the default hash function. (継承元 Object) |
GetType() |
現在のインスタンスの Type を取得します。Gets the Type of the current instance. (継承元 Object) |
InvokeEventHandler(Delegate, Object) |
型固有の方法でイベント ハンドラーを呼び出します。これにより、イベント システムの効率を高めることができます。Invokes event handlers in a type-specific way, which can increase event system efficiency. |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。Creates a shallow copy of the current Object. (継承元 Object) |
OnSetSource(Object) |
派生クラスでオーバーライドした場合、インスタンスの Source プロパティの値が変更されるたびに、通知コールバックのエントリ ポイントを提供します。When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. (継承元 RoutedEventArgs) |
ToString() |
現在のオブジェクトを表す string を返します。Returns a string that represents the current object. (継承元 Object) |