[UWP] [XBOX] [C#]为什么我没有在Xbox One上获得非英语虚拟键盘的CharacterReceived事件 [英] [UWP][XBOX][C#]Why am I not getting a CharacterReceived event for non english Virtual Keyboards on Xbox One

查看:82
本文介绍了[UWP] [XBOX] [C#]为什么我没有在Xbox One上获得非英语虚拟键盘的CharacterReceived事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试处理包含在UWP应用程序中的自定义3D游戏引擎的文本字段中的字符。



要用英语处理这些字符,我们一直在使用  CoreWindows 's  CharacterReceived events。
这对带有英语语言环境的Xbox One没有问题。我们将捕获的字符发送到引擎并进行适当渲染。 / p>


但是,当我们更改虚拟键盘的语言时(例如法语加拿大,西班牙语墨西哥),我们遇到了一个问题。对于大多数角色,事件不会触发,例如  @ ,  <
和  >
阻止我们将符号传播到我们的引擎。字母数字字符仍然有效。



我在C#中创建了一个示例应用程序,使我们的引擎完全脱离了等式,我得到了完全相同的结果。以下是相关的示例代码:

  protected override void OnWindowCreated(WindowCreatedEventArgs args){
base.OnWindowCreated(args);

var window = args.Window;
window.CoreWindow。 CharacterReceived + = CoreWindow_CharacterReceived;
}

private void CoreWindow_CharacterReceived(CoreWindow sender,CharacterReceivedEventArgs args)
{
System.Diagnostics.Debug.WriteLine(" Received Event KeyCode) :{0},KeyStatus:{1}",args.KeyCode,args.KeyStatus.ToString());
}



我可以处理按键,但我不想去那个兔子洞,因为每个地区都不同。



知道为什么这个事件不处理符号?

解决方案

另外,我有一个文本字段,允许我在示例应用程序的屏幕上显示VKB。


I'm trying to process characters in a text field for a custom 3D game engine wrapped in a UWP application.

To process these characters in English, we have been using CoreWindows's CharacterReceivedevents. This works without a problem on the Xbox One with the english locale. We send our captured characters to the engine and it renders appropriately.

However, we are running into an issue when we change the language of the virtual keyboard (example french Canada, spanish mexico). The event does not fire for most characters, example, @<, and >, which prevents us from propagating the symbols to our engine. Alphanumeric characters still work.

I've created a sample application in C# to take our engine out of the equation entirely and I'm getting the exact same results. Here's the relevant sample code:

protected override void OnWindowCreated(WindowCreatedEventArgs args){
    base.OnWindowCreated(args);

    var window = args.Window;
    window.CoreWindow.CharacterReceived += CoreWindow_CharacterReceived;
}

private void CoreWindow_CharacterReceived(CoreWindow sender, CharacterReceivedEventArgs args)
{
    System.Diagnostics.Debug.WriteLine("Received Event KeyCode: {0}, KeyStatus: {1}", args.KeyCode, args.KeyStatus.ToString());
}

I could process keypresses, but I would rather not go that rabbit hole as it is different for each locale.

Any idea why this event is not processing symbols?

解决方案

Also, I have a text field that allows me to show the VKB on screen in the sample application.


这篇关于[UWP] [XBOX] [C#]为什么我没有在Xbox One上获得非英语虚拟键盘的CharacterReceived事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆