forked from binaryage/visor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new clipboard preference option, "Paste on Right Click" to help w…
…ith two-button mice (e.g. Magic Mouse)
- Loading branch information
Showing
4 changed files
with
121 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Created by Anmol Khirbat on 1/18/10. | ||
|
||
@interface TerminalCopyOnSelect : NSObject { | ||
} | ||
+ (void)load; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Created by Anmol Khirbat on 1/18/10. | ||
|
||
#import "PasteOnRightclick.h" | ||
#import "JRSwizzle.h" | ||
#import "Macros.h" | ||
|
||
@implementation NSView (PasteOnRightclick) | ||
- (void) Visor_rightMouseDown:(NSEvent *)theEvent | ||
{ | ||
bool pasteOnRightclick = [[NSUserDefaults standardUserDefaults] boolForKey:@"VisorPasteOnRightclick"]; | ||
|
||
if (pasteOnRightclick) | ||
[(id)self performSelector:@selector(paste:) withObject:nil]; | ||
else | ||
[self Visor_rightMouseDown:theEvent]; | ||
} | ||
@end | ||
|
||
@implementation PasteOnRightclick | ||
+ (void) load { | ||
[NSClassFromString(@"TTView") jr_swizzleMethod:@selector(rightMouseDown:) | ||
withMethod:@selector(Visor_rightMouseDown:) error:NULL]; | ||
LOG(@"PasteOnRightclick installed"); | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters