public void KeyDownAnywhere(object sender, KeyEventArgs e) { if (buttonBeingEdited == KeypadButton.None) { return; } Key key = e.Key == Key.System ? e.SystemKey : e.Key; switch (buttonBeingEdited) { case KeypadButton.Left: Keybinds.LeftButtonScanCode = KeyCodeConverter.FromScanCode(key).ScanCode; break; case KeypadButton.Right: Keybinds.RightButtonScanCode = KeyCodeConverter.FromScanCode(key).ScanCode; break; case KeypadButton.Side: Keybinds.SideButtonScanCode = KeyCodeConverter.FromScanCode(key).ScanCode; break; } if (!Keybinds.PushAllValues()) { Console.WriteLine("Readback failed"); } NotifyAllProperties(); }