C# - System.Windows.Forms.Keys - How to keep application hotkeys in one place
问题 I have few "hotkeys" in my application. All "hotkeys" sequences are unique in application scope (so for example F12 key will always fire the same single task). In few places there are handled like here: if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.Delete) { this.Close(); } if (e.Modifiers == Keys.Shift && e.KeyCode == Keys.Up) { if (Program.PerformLogin()) { frmConfigurationSetup frmSetup = new frmConfigurationSetup(); frmSetup.Show(); } } if (e.KeyCode == Keys.F12) { frmAbout formAbout