in my uwp app I just added a new page and navigated to it, and I have nothing on that page just the default grid. but I am trying to recieve keydown events which is not firing up by any key at all. I have also put keydown to the grid on xaml and to the page in code behind, but it is still not firing up I have assured that with break points.
xaml
<Grid KeyDown="VideoPageKeyDown">
</Grid>
code behind
public sealed partial class VideoPlay : Page
{
public VideoPlay()
{
this.InitializeComponent();
KeyDown += VideoPageKeyDown;
}
private void VideoPageKeyDown(object sender, KeyRoutedEventArgs e)
{
if (e.Key == VirtualKey.GamepadDPadDown
|| e.Key == VirtualKey.GamepadLeftThumbstickDown)
{
//VideoMenuGrid.Visibility = Visibility.Visible;
//await VideoMenuGrid.Offset(200f, 0f, 1000, 0).StartAsync();
}
else if (e.Key == VirtualKey.GamepadDPadUp
|| e.Key == VirtualKey.GamepadLeftThumbstickUp)
{
//await VideoMenuGrid.Offset(0f, 0f, 1000, 0).StartAsync();
//VideoMenuGrid.Visibility = Visibility.Collapsed;
}
}
}