Skip to content
Snippets Groups Projects
Commit d88b43ff authored by George Nachman's avatar George Nachman
Browse files

Require a minimum delay between taps of a modifier key for people whose...

Require a minimum delay between taps of a modifier key for people whose keyboards don't debounce. Issue 6206
parent eba35576
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -145,6 +145,7 @@
+ (BOOL)includePasteHistoryInAdvancedPaste;
+ (BOOL)experimentalKeyHandling;
+ (double)hotKeyDoubleTapMaxDelay;
+ (double)hotKeyDoubleTapMinDelay;
+ (BOOL)hideStuckTooltips;
+ (BOOL)indicateBellsInDockBadgeLabel;
+ (double)tabFlashAnimationDuration;
Loading
Loading
Loading
Loading
@@ -142,6 +142,7 @@ DEFINE_FLOAT(hotkeyTermAnimationDuration, 0.25, @"Hotkey: Duration in seconds of
DEFINE_BOOL(dockIconTogglesWindow, NO, @"Hotkey: If the only window is a hotkey window, then clicking the dock icon shows or hides it.");
DEFINE_BOOL(hotkeyWindowFloatsAboveOtherWindows, NO, @"Hotkey: The hotkey window floats above other windows even when another application is active.\nYou must disable “Prefs > Keys > Hotkey window hides when focus is lost” for this setting to be effective.");
DEFINE_FLOAT(hotKeyDoubleTapMaxDelay, 0.3, @"Hotkey: The maximum amount of time allowed between presses of a modifier key when performing a modifier double-tap.");
DEFINE_FLOAT(hotKeyDoubleTapMinDelay, 0.01, @"Hotkey: The minimum amount of time required between presses of a modifier key when performing a modifier double-tap.");
 
#pragma mark General
DEFINE_STRING(searchCommand, @"https://google.com/search?q=%@", @"General: Template for URL of search engine.\niTerm2 replaces the string “%@” with the text to search for. Query parameter percent escaping is used.");
Loading
Loading
Loading
Loading
@@ -180,7 +180,9 @@ ITERM_WEAKLY_REFERENCEABLE
NSTimeInterval time = [NSDate timeIntervalSinceReferenceDate];
DLog(@"You pressed the modifier key. dt=%@", @(time - _lastModifierTapTime));
const NSTimeInterval kMaxTimeBetweenTaps = [iTermAdvancedSettingsModel hotKeyDoubleTapMaxDelay];
BOOL result = (time - _lastModifierTapTime < kMaxTimeBetweenTaps);
const NSTimeInterval kMinTimeBetweenTabs = [iTermAdvancedSettingsModel hotKeyDoubleTapMinDelay];
const NSTimeInterval elapsedTime = time - _lastModifierTapTime;
BOOL result = (kMinTimeBetweenTabs <= elapsedTime && elapsedTime < kMaxTimeBetweenTaps);
_lastModifierTapTime = time;
return result;
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment