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 CharacterReceived
events. 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());
}
The sample app has a TextBox defined in Xaml to allow me to bring up the Keyboard as well. The text field processes the symbols well, but the event does not.
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?