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,10 +82,14 @@
} }
- (void)willShowTab { - (void)willShowTab {
if(!_hotKey) {
_hotKey = [DDHotKey hotKeyWithKeyData:[NSUserDefaults.standardUserDefaults dataForKey:kMPSettingsKeyGlobalAutotypeKeyDataKey]]; _hotKey = [DDHotKey hotKeyWithKeyData:[NSUserDefaults.standardUserDefaults dataForKey:kMPSettingsKeyGlobalAutotypeKeyDataKey]];
/* Change any invalid hotkeys to valid ones? */ }
/* 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; self.hotKeyTextField.hotKey = self.hotKey;
} }
}
#pragma mark - #pragma mark -
#pragma mark Properties #pragma mark Properties