IKeyboardInputSink IKeyboardInputSink IKeyboardInputSink IKeyboardInputSink Interface

定義

為元件提供鍵盤接收,這些元件會管理 Interop 界限中和 HWND 之間的定位鍵、快速鍵和助憶鍵 (Mnemonics)。Provides a keyboard sink for components that manages tabbing, accelerators, and mnemonics across interop boundaries and between HWNDs. 這個介面實作 WPF-Win32 交互操作案例中的鍵盤訊息管理。This interface implements keyboard message management in WPF-Win32 interoperation scenarios.

public interface class IKeyboardInputSink
public interface IKeyboardInputSink
type IKeyboardInputSink = interface
Public Interface IKeyboardInputSink
衍生

備註

鍵盤接收會處理輸入的整體的鍵盤輸入模型的特定子集Win32Win32Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF),並可讓某些鍵盤的輸入處理和 Hwnd 導向不是使用目前的鍵盤焦點。A keyboard sink handles input from particular subsets of the overall keyboard input model for Win32Win32 and Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF), and enables some keyboard input to be processed and directed to HWNDs other than the one with current keyboard focus.

如果您的元件包含其他元件,而且會維護定位順序,也必須實作您的元件IKeyboardInputSite以及追蹤哪些元件有焦點。If your component contains other components, and maintains a tab order, your component must also implement IKeyboardInputSite and keep track of which component has focus.

如需輸入特別針對實作的架構的討論Windows FormsWindows Formsinterop,請參閱Windows Forms 和 WPF 互通性輸入架構For a discussion of the input architecture specifically implemented for Windows FormsWindows Forms interop, see Windows Forms and WPF Interoperability Input Architecture.

HwndSourceHwndHost每個實作IKeyboardInputSink介面,透過明確介面定義。HwndSource and HwndHost each implement the IKeyboardInputSink interface, through explicit interface definitions. 明確的定義會提供預設行為,也可以存取,如果需要透過IKeyboardInputSink介面的類型轉換HwndSourceHwndHostThe explicit definitions supply default behaviors, and can also be accessed if necessary through an IKeyboardInputSink interface cast of HwndSource or HwndHost.

屬性

KeyboardInputSite KeyboardInputSite KeyboardInputSite KeyboardInputSite

取得或設定對元件容器之 IKeyboardInputSite 介面的參考。Gets or sets a reference to the component's container's IKeyboardInputSite interface.

方法

HasFocusWithin() HasFocusWithin() HasFocusWithin() HasFocusWithin()

取得值,這個值表示接收或其包含的其中一個元件是否有焦點。Gets a value that indicates whether the sink or one of its contained components has focus.

OnMnemonic(MSG, ModifierKeys) OnMnemonic(MSG, ModifierKeys) OnMnemonic(MSG, ModifierKeys) OnMnemonic(MSG, ModifierKeys)

當叫用這個接收的其中一個助憶鍵 (便捷鍵 (Access Key)) 時呼叫。Called when one of the mnemonics (access keys) for this sink is invoked.

RegisterKeyboardInputSink(IKeyboardInputSink) RegisterKeyboardInputSink(IKeyboardInputSink) RegisterKeyboardInputSink(IKeyboardInputSink) RegisterKeyboardInputSink(IKeyboardInputSink)

註冊所包含之元件的 IKeyboardInputSink 介面。Registers the IKeyboardInputSink interface of a contained component.

TabInto(TraversalRequest) TabInto(TraversalRequest) TabInto(TraversalRequest) TabInto(TraversalRequest)

將焦點設定在接收的第一個定位停駐點 (Tab Stop) 或最後一個定位停駐點。Sets focus on either the first tab stop or the last tab stop of the sink.

TranslateAccelerator(MSG, ModifierKeys) TranslateAccelerator(MSG, ModifierKeys) TranslateAccelerator(MSG, ModifierKeys) TranslateAccelerator(MSG, ModifierKeys)

在 Keydown 訊息層級處理鍵盤輸入。Processes keyboard input at the keydown message level.

TranslateChar(MSG, ModifierKeys) TranslateChar(MSG, ModifierKeys) TranslateChar(MSG, ModifierKeys) TranslateChar(MSG, ModifierKeys)

請先處理 WM_CHAR、WM_SYSCHAR、WM_DEADCHAR 和 WM_SYSDEADCHAR 輸入訊息,然後再呼叫 OnMnemonic(MSG, ModifierKeys)Processes WM_CHAR, WM_SYSCHAR, WM_DEADCHAR, and WM_SYSDEADCHAR input messages before OnMnemonic(MSG, ModifierKeys) is called.

適用於

另請參閱