Hi, I did the following test and I'm receiving the key events (KeyDown, KeyUp and TextInput) for all keys pressed, not only for Chinese scripts.
<UserControl x:Class="Tests.ImageKeyEvents"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Image x:Name="TheImage" Source="Images/PanelBg.png" Stretch="None"/>
</UserControl>
struct ImageKeyEvents: public UserControl
{
ImageKeyEvents()
{
InitializeComponent();
Image* image = FindName<Image>("TheImage");
image->SetFocusable(true);
Loaded() += [image](BaseComponent*, const RoutedEventArgs&)
{
image->Focus();
};
image->KeyDown() += [](BaseComponent*, const KeyEventArgs& e)
{
NS_LOG_INFO("KeyDown %d %d", (int)e.key, (int)e.keyStates);
};
image->KeyUp() += [](BaseComponent*, const KeyEventArgs& e)
{
NS_LOG_INFO("KeyDown %d %d", (int)e.key, (int)e.keyStates);
};
image->TextInput() += [](BaseComponent*, const TextCompositionEventArgs& e)
{
char utf8Char[5] = { 0, 0, 0, 0, 0 };
UTF8::Append(e.ch, utf8Char);
NS_LOG_INFO("TextInput %s", utf8Char);
};
}
private:
void InitializeComponent()
{
GUI::LoadComponent(this, "ImageTextEvents.xaml");
}
NS_IMPLEMENT_INLINE_REFLECTION_(ImageKeyEvents, UserControl, "Tests.ImageKeyEvents")
};
Perhaps you are focusing the image before it is loaded and connected to the UI tree?
Could you make sure image has keyboard focus when pressing the keys?
And remember that the TextInput event provides an unicode character and maybe you need to convert it to utf8 to use it (just as I did in my code).