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) 

事件类型

注解

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

适用于

另请参阅