InputKeyboardSource.KeyDown 事件

定义

当用户在 ALT 键未按下时按下键时发生。

// Register
event_token KeyDown(TypedEventHandler<InputKeyboardSource, KeyEventArgs const&> const& handler) const;

// Revoke with event_token
void KeyDown(event_token const* cookie) const;

// Revoke with event_revoker
InputKeyboardSource::KeyDown_revoker KeyDown(auto_revoke_t, TypedEventHandler<InputKeyboardSource, KeyEventArgs const&> const& handler) const;
public event TypedEventHandler<InputKeyboardSource,KeyEventArgs> KeyDown;
function onKeyDown(eventArgs) { /* Your code */ }
inputKeyboardSource.addEventListener("keydown", onKeyDown);
inputKeyboardSource.removeEventListener("keydown", onKeyDown);
- or -
inputKeyboardSource.onkeydown = onKeyDown;
Public Custom Event KeyDown As TypedEventHandler(Of InputKeyboardSource, KeyEventArgs) 

事件类型

注解

启用输入法编辑器(IME)时,应用不会收到此事件。 输入法编辑器(IME)处理所有键盘输入并将 处理 设置为 true。

适用于

另请参阅