共用方式為


ICoreWindow.KeyDown 事件

定義

按下非系統按鍵時所引發的事件。

此事件的委派類型為 TypedEventHandler<TSender,TResult>,其中 TSender 的類型為 CoreWindow而 TResult 的類型為 KeyEventArgs

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

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

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

事件類型

適用於

另請參閱