Skip to content

Commit

Permalink
mouse scroll to choose clippings and double click to paste
Browse files Browse the repository at this point in the history
  • Loading branch information
TermiT committed Apr 3, 2016
1 parent 5e25980 commit d583141
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
-(void) showBezel;
-(void) hideBezel;
-(void) processBezelKeyDown:(NSEvent *)theEvent;
-(void) processBezelMouseEvents:(NSEvent *)theEvent;
-(void) metaKeysReleased;

// Menu related
Expand Down
17 changes: 15 additions & 2 deletions AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,19 @@ - (void)processBezelKeyDown:(NSEvent *)theEvent {
DLog(@"CODE %ld", (long)[mainRecorder keyCombo].code);
break;
}
}
}
}

-(void) processBezelMouseEvents:(NSEvent *)theEvent {
if (theEvent.type == NSScrollWheel) {
if (theEvent.deltaY > 0.0f) {
[self stackUp];
} else if (theEvent.deltaY < 0.0f) {
[self stackDown];
}
} else if (theEvent.type == NSLeftMouseUp && theEvent.clickCount == 2) {
[self pasteFromStack];
}
}

- (void)applicationDidFinishLaunching:(NSNotification *)notification
Expand Down Expand Up @@ -1048,7 +1060,8 @@ - (void) showBezel
[bezel setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces];
// if ([[NSUserDefaults standardUserDefaults] boolForKey:@"popUpAnimation"])
// [bezel makeKeyAndOrderFrontWithPopEffect];
else [bezel makeKeyAndOrderFront:self];
// else
[bezel makeKeyAndOrderFront:self];
isBezelDisplayed = YES;
}

Expand Down
9 changes: 9 additions & 0 deletions UI/BezelWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@ - (void)scrollWheel:(NSEvent *)theEvent
}
}

- (void)mouseUp:(NSEvent *)theEvent
{
if ( [self delegate] )
{
[delegate performSelector:@selector(processBezelMouseEvents:) withObject:theEvent];
}
}



- (void)keyDown:(NSEvent *)theEvent {
if ( [self delegate] )
Expand Down

0 comments on commit d583141

Please sign in to comment.