Control.FocusEngaged 事件

定義

發生於使用者按下遊戲控制器上的 A/Select 按鈕時,焦點受限於控件。

// Register
event_token FocusEngaged(TypedEventHandler<Control, FocusEngagedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
Control::FocusEngaged_revoker FocusEngaged(auto_revoke_t, TypedEventHandler<Control, FocusEngagedEventArgs const&> const& handler) const;
public event TypedEventHandler<Control,FocusEngagedEventArgs> FocusEngaged;
function onFocusEngaged(eventArgs) { /* Your code */ }
control.addEventListener("focusengaged", onFocusEngaged);
control.removeEventListener("focusengaged", onFocusEngaged);
- or -
control.onfocusengaged = onFocusEngaged;
Public Custom Event FocusEngaged As TypedEventHandler(Of Control, FocusEngagedEventArgs) 
<control FocusEngaged="eventhandler"/>

事件類型

備註

IsFocusEngagementEnabled 屬性設定為 true 時,它會將控件標示為需要焦點參與。 這表示,使用者必須按下 \[A/選取\] 按鈕來「佔住」控制項並與它互動。 完成時,他們可以按 B/上一頁按鈕來解除控件並離開控件。

焦點參與可讓您更輕鬆地使用遊戲控制器來與應用程式互動。 設定焦點參與不會影響鍵盤或其他輸入設備。 如需詳細資訊,請參閱 焦點參與

適用於

另請參閱