diff --git a/UWPHook/EventsHook.cs b/UWPHook/EventsHook.cs index 4e918aa..0f6cab7 100644 --- a/UWPHook/EventsHook.cs +++ b/UWPHook/EventsHook.cs @@ -49,10 +49,12 @@ namespace UWPHook private void KeyboardWatcher_OnKeyInput(object sender, KeyInputEventArgs e) { - KeyToXboxButton button = (KeyToXboxButton)keyboardToController.ListButtons.Select(x => x.Key == e.KeyData.Keyname); - - controller.Buttons ^= button.x360Buttons; - _scpBus.Report((int)1, controller.GetReport(), _outputReport); + KeyToXboxButton button = keyboardToController.ListButtons.FirstOrDefault(x => x.Key == e.KeyData.Keyname); + if (button != null) //We do have a bind for this key + { + controller.Buttons ^= button.x360Buttons; + _scpBus.Report((int)1, controller.GetReport(), _outputReport); + } } internal void StopHooking() diff --git a/UWPHook/GamesWindow.xaml b/UWPHook/GamesWindow.xaml index 574ff9c..38dca23 100644 --- a/UWPHook/GamesWindow.xaml +++ b/UWPHook/GamesWindow.xaml @@ -35,11 +35,12 @@ - + + + + + +