CharacterReceivedEventArgs 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供輸入佇列收到字元時所引發之事件所傳回的引數。
public ref class CharacterReceivedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class CharacterReceivedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class CharacterReceivedEventArgs
Public NotInheritable Class CharacterReceivedEventArgs
- 繼承
- 屬性
- 實作
Windows 需求
裝置系列 |
Windows 10 (已於 10.0.10240.0 引進)
|
API contract |
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)
|
備註
Windows 10應用程式在啟用輸入法編輯器 (輸入法) 時,不會收到此事件。 輸入法編輯器 (輸入法) 處理所有鍵盤輸入,並將 Handled 設定為 true。
Windows Phone原生應用程式僅支援此 API。
這個物件是由註冊給下列事件的委派所傳回:
void SetWindow(CoreWindow const& window)
{
...
window.CharacterReceived({this, &App::OnCharacterReceived });
}
// Character received event data in CharacterReceivedEventArgs.
void OnCharacterReceived(
Windows::UI::Core::CoreWindow const& /* sender */,
Windows::UI::Core::CharacterReceivedEventArgs const& /* args */)
{
}
// returning character received events data through CharacterReceivedEventArgs
void MyCoreWindowEvents::SetWindow( // implementation called by CoreApplication::Run(), provided for context
_In_ CoreWindow^ window
)
{
// ...
window->CharacterReceived +=
ref new TypedEventHandler<CoreWindow^, CharacterReceivedEventArgs^>(this, &CoreWindowEvents::OnCharacterReceived);
// ...
}
注意
這個類別不是敏捷的,這表示您必須考慮其執行緒模型和封送處理行為。 如需詳細資訊,請參閱 執行緒和封送處理 (C++/CX) 。
屬性
Handled |
取得或設定是否處理字元接收事件。 |
KeyCode |
取得輸入佇列所接收之字元的索引鍵碼。 |
KeyStatus |
取得引發字元接收事件之實體按鍵按下的狀態。 |