共用方式為


CoreComponentInputSource.KeyDown 事件

定義

按下目前作用中裝載 XAML 元素的按鍵時引發。

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

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

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

事件類型

適用於