KeyboardDevice 類別

定義

表示鍵盤裝置的抽象類別。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
繼承

備註

KeyboardDevice 支援基礎結構,但不適合直接從您Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)的程式碼使用。The KeyboardDevice supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

針對鍵盤相關輸入, 請使用Keyboard類別。For keyboard related input, use the Keyboard class. Keyboard類別代表應用程式的鍵盤, 並提供可反映鍵盤狀態的方法、屬性和事件。The Keyboard class represents the keyboard to an application and provides methods, properties, and events that reflect the state of the keyboard.

類別會委派至適當KeyboardDevice的。 KeyboardThe Keyboard class delegates to the appropriate KeyboardDevice.

InputDevice個物件都代表一個特定的輸入裝置。Each InputDevice object represents one particular input device. 例如, 如果有兩個滑鼠, 則會有兩個InputDevice物件。For example, if there are two mice, there will be two InputDevice objects.

建構函式

KeyboardDevice(InputManager)

初始化 KeyboardDevice 類別的新執行個體。Initializes a new instance of the KeyboardDevice class.

屬性

ActiveSource

取得報告這個裝置之輸入的 PresentationSourceGets the PresentationSource that is reporting input for this device.

DefaultRestoreFocusMode

取得或設定 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 在還原焦點時的行為。Gets or sets the behavior of Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) when restoring focus.

Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(繼承來源 DispatcherObject)
FocusedElement

取得擁有鍵盤焦點的項目。Gets the element that has keyboard focus.

Modifiers

取得目前已按下的 ModifierKeys 集。Gets the set of ModifierKeys which are currently pressed.

Target

取得接收此裝置輸入之指定的 IInputElementGets the specified IInputElement that input from this device is sent to.

方法

CheckAccess()

判斷呼叫的執行是否可以存取這個 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)
ClearFocus()

清除焦點。Clears focus.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Focus(IInputElement)

在指定的 IInputElement 上設定鍵盤焦點。Sets keyboard focus on the specified IInputElement.

GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetKeyStates(Key)

取得指定之 Key 的按鍵狀態集。Gets the set of key states for the specified Key.

GetKeyStatesFromSystem(Key)

在衍生類別中覆寫時,取得指定之 KeyStatesKeyWhen overridden in a derived class, obtains the KeyStates for the specified Key.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IsKeyDown(Key)

判斷指定的 Key 是否為已按下狀態。Determines whether the specified Key is in the down state.

IsKeyToggled(Key)

判斷指定的 Key 是否為已切換狀態。Determines whether the specified Key is in the toggled state.

IsKeyUp(Key)

判斷指定的 Key 是否為已放開狀態。Determines whether the specified Key is in the up state.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)

適用於

另請參閱