Hello,
Welcome to Microsoft Q&A,
While typing "6" in french keyboard it enters like "-6" in UWP Platforms
Derive from official document, it's by-design within UWP input control for no-us keyboard layout. if you want to input number, you could switch to US-keyboard or press Shift
+ Number
. And you could also use the following code the detect which key pressed then convert it to the char.
private static char? ToChar(VirtualKey key, bool shift)
{
if (32 == (int)key)
return ' ';
VirtualKey search;
foreach (var letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
{
if (Enum.TryParse<VirtualKey>(letter.ToString(), out search) && search.Equals(key))
return (shift) ? letter : letter.ToString().ToLower()[0];
}
foreach (var number in "1234567890")
{
if (Enum.TryParse<VirtualKey>("Number" + number.ToString(), out search) && search.Equals(key))
return number;
}
return null;
}
Usage
private void MyTextBox_KeyDown(object sender, KeyRoutedEventArgs e)
{
var c = ToChar(e.Key, false);
}