Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
SRKeyCodeTransformer *srTransformer;
BOOL isBezelDisplayed;
BOOL isBezelPinned;
NSTimeInterval lastPasteFromStackTime;
NSString *currentKeycodeCharacter;
NSDateFormatter* dateFormat;

Expand Down
8 changes: 8 additions & 0 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,14 @@ - (void)restoreStashedStoreAndUpdate
- (void)pasteFromStack
{
NSLog(@"pasteFromStack called");
// Releasing the modifier keys and pressing Return within a fraction of a second
// both trigger a paste, so the same bezel selection would be pasted twice.
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
if ( now - lastPasteFromStackTime < 0.6 ) {
NSLog(@"pasteFromStack ignored - duplicate trigger within 0.6s");
return;
}
lastPasteFromStackTime = now;
NSString *content = [flycutOperator getPasteFromStackPosition];
if ( nil != content ) {
NSLog(@"Content found, adding to pasteboard and preparing to paste: %@", [content substringToIndex:MIN(content.length, 50)]);
Expand Down