Fixed hotkeys being unregistered when changing tabs. Fixes #883

This commit is contained in:
Michael Starke
2021-11-03 00:26:30 +01:00
parent 65f2582e3c
commit eedc804558

View File

@@ -82,9 +82,13 @@
}
- (void)willShowTab {
_hotKey = [DDHotKey hotKeyWithKeyData:[NSUserDefaults.standardUserDefaults dataForKey:kMPSettingsKeyGlobalAutotypeKeyDataKey]];
/* Change any invalid hotkeys to valid ones? */
self.hotKeyTextField.hotKey = self.hotKey;
if(!_hotKey) {
_hotKey = [DDHotKey hotKeyWithKeyData:[NSUserDefaults.standardUserDefaults dataForKey:kMPSettingsKeyGlobalAutotypeKeyDataKey]];
}
/* Only call the setter if the hotkeys are different, otherwise the dealloc call will unregister them*/
if(![self.hotKeyTextField.hotKey isEqual:self.hotKey]) {
self.hotKeyTextField.hotKey = self.hotKey;
}
}
#pragma mark -