private void RegisterHotkey(string hotkey) { try { // Format <modifier> + <key> var keys = hotkey.Split(new[] { '+' }, StringSplitOptions.RemoveEmptyEntries); var modifier = Hotkey.GetKey(keys[0]); var key = Hotkey.GetKey(keys[1]); if (!RegisterHotkey(modifier, key)) { throw new Exception( string.Format("Fail to register hotkey {0}", hotkey)); } } catch (Exception ex) { // TODO: log the error } }