簡體   English   中英

Unicode輸入Windows 8.1 Store App

[英]Unicode input Windows 8.1 Store App

如果我按鍵盤上的一個鍵,我想接收正確的本地化Unicode-Char。 (在使用C ++或C#的Windows 8.1 Store App中)

我目前正在通過KeyEventArgs -Event接收鍵盤輸入

C ++:

Windows::UI::Core::CoreWindow^ window = Windows::UI::Core::CoreWindow::GetForCurrentThread();
window->KeyDown += ref new Windows::Foundation::TypedEventHandler<Windows::UI::Core::CoreWindow^, Windows::UI::Core::KeyEventArgs^>(this, &ComponentInterface::OnKeyDown);

void ComponentInterface::OnKeyDown(Windows::UI::Core::CoreWindow^ window, Windows::UI::Core::KeyEventArgs^ e)
{
    unsigned int key = e->KeyStatus.ScanCode;
}

獲取字符句柄CoreWindow :: CharacterReceived而不是CoreWindow :: KeyDown

KeyDown事件僅提供密鑰本身,而沒有單獨包含足夠的上下文來知道最終將生成哪個字符。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM