adium 4063:b2f504303835: Added Cmd-Shift-Arrows and Cmd-Shift-Br...

commits at adium.im commits at adium.im
Sun Jul 24 20:35:15 UTC 2011


details:	http://hg.adium.im/adium/rev/b2f504303835
revision:	4063:b2f504303835
branch:		(none)
author:		Patrick Steinhardt <steinhardt.p at me.com>
date:		Sun Jul 24 22:30:02 2011 +0200

Added Cmd-Shift-Arrows and Cmd-Shift-Brackets to cycle tabs. Fixes #15221.

diffs (59 lines):

diff -r 9f9108ee2326 -r b2f504303835 Source/AIChatCyclingPlugin.m
--- a/Source/AIChatCyclingPlugin.m	Wed Jul 20 14:04:11 2011 +0200
+++ b/Source/AIChatCyclingPlugin.m	Sun Jul 24 22:30:02 2011 +0200
@@ -20,6 +20,9 @@
 #import "ESGeneralPreferencesPlugin.h"
 #import <AIUtilities/AIMenuAdditions.h>
 
+#import "SGHotKey.h"
+#import "SGHotKeyCenter.h"
+
 #define PREVIOUS_MESSAGE_MENU_TITLE		AILocalizedString(@"Select Previous Chat",nil)
 #define NEXT_MESSAGE_MENU_TITLE			AILocalizedString(@"Select Next Chat",nil)
 
@@ -38,7 +41,8 @@
 {
 	id<AIMenuController>	menuController = adium.menuController;
 	NSMenuItem				*nextChatMenuItem, *previousChatMenuItem;
-
+    SGHotKey                *hotKey;
+	
 	//Cycling menu items
 	nextChatMenuItem = [[NSMenuItem alloc] initWithTitle:NEXT_MESSAGE_MENU_TITLE 
 												  target:self
@@ -53,6 +57,35 @@
 											   keyEquivalent:@"\t"];
 	[previousChatMenuItem setKeyEquivalentModifierMask:(NSControlKeyMask | NSShiftKeyMask)];
 	[menuController addMenuItem:previousChatMenuItem toLocation:LOC_Window_Commands];
+    
+    //Cycling key bindings
+    hotKey = [[SGHotKey alloc] initWithIdentifier:@"Next Tab Arrow"
+                                         keyCombo:[[SGKeyCombo alloc] initWithKeyCode:kVK_RightArrow
+                                                                            modifiers:(kCommandUnicode | kShiftUnicode)]
+                                           target:self 
+                                           action:@selector(nextChat:)];
+    [[SGHotKeyCenter sharedCenter] registerHotKey:hotKey];
+    
+    hotKey = [[SGHotKey alloc] initWithIdentifier:@"Previous Tab Arrow"
+                                         keyCombo:[[SGKeyCombo alloc] initWithKeyCode:kVK_LeftArrow
+                                                                            modifiers:(kCommandUnicode | kShiftUnicode)]
+                                           target:self
+                                           action:@selector(previousChat:)];
+    [[SGHotKeyCenter sharedCenter] registerHotKey:hotKey];
+    
+    hotKey = [[SGHotKey alloc] initWithIdentifier:@"Next Tab Bracket"
+                                         keyCombo:[[SGKeyCombo alloc] initWithKeyCode:kVK_ANSI_RightBracket
+                                                                            modifiers:(kCommandUnicode | kShiftUnicode)]
+                                           target:self
+                                           action:@selector(nextChat:)];
+    [[SGHotKeyCenter sharedCenter] registerHotKey:hotKey];
+    
+    hotKey = [[SGHotKey alloc] initWithIdentifier:@"Previous Tab Bracket" 
+                                         keyCombo:[[SGKeyCombo alloc] initWithKeyCode:kVK_ANSI_LeftBracket
+                                                                            modifiers:(kCommandUnicode | kShiftUnicode)]
+                                           target:self
+                                           action:@selector(previousChat:)];
+    [[SGHotKeyCenter sharedCenter] registerHotKey:hotKey];
 }
 
 - (void)uninstallPlugin




More information about the commits mailing list