Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 78 lines (62 sloc) 2.288 kb
db85bc7 Add remaining plugins
jnj authored
1 //
2 // QSProcessSwitcherSupportPlugIn.m
3 // QSProcessSwitcherSupportPlugIn
4 //
5 // Created by Nicholas Jitkoff on 9/17/05.
6 // Copyright __MyCompanyName__ 2005. All rights reserved.
7 //
8
9 #import "QSProcessSwitcherSupportPlugIn.h"
10
11 #import <QSCore/QSRegistry.h>
12 #import <QSFoundation/NDHotKeyEvent_QSMods.h>
13
14
15 @implementation QSRegistry (QSProcessSwitcher)
16 - (NSString *)preferredProcessSwitcherID{
17 //NSLog(@"pref?");
18 NSString *key=[[NSUserDefaults standardUserDefaults] stringForKey:kQSProcessSwitchers];
19 if (!key)key=[[[self tableNamed:kQSProcessSwitchers]allKeys]lastObject];
20 return key;
21 }
22
23 - (id <QSProcessSwitcher>)preferredProcessSwitcher{
24 id mediator=[prefInstances objectForKey:kQSProcessSwitchers];
25 if (!mediator){
26 mediator=[self instanceForKey:[self preferredProcessSwitcherID]
27 inTable:kQSProcessSwitchers];
28 if (mediator)
29 [prefInstances setObject:mediator forKey:kQSProcessSwitchers];
30 }
31 return mediator;
32 }
33 @end
34
35 @implementation QSProcessSwitcherSupportPlugIn
36
37 mSHARED_INSTANCE_CLASS_METHOD
38
39 + (void)loadPlugIn{
40
41 // QSHotKeyEvent *switcherKey=(QSHotKeyEvent *)[QSHotKeyEvent getHotKeyForKeyCode:48
42 // character:0
43 // modifierFlags:NSControlKeyMask];
44 // [switcherKey setTarget:[self sharedInstance] selectorReleased:(SEL)0 selectorPressed:@selector(switchToNextApp)];
45 // [switcherKey setIdentifier:@"QSSwitchAppliciationHotKey"];
46 // [switcherKey setEnabled:YES];
47 //// NSLog(@"hot %@",switcherKey);
48 // switcherKey=(QSHotKeyEvent *)[QSHotKeyEvent getHotKeyForKeyCode:48
49 // character:0
50 // modifierFlags:NSControlKeyMask|NSShiftKeyMask];
51 // [switcherKey setTarget:[self sharedInstance] selectorReleased:(SEL)0 selectorPressed:@selector(switchToPrevApp)];
52 // [switcherKey setIdentifier:@"QSSwitchBackAppliciationHotKey"];
53 // [switcherKey setEnabled:YES];
54 [QSReg preferredProcessSwitcher];
55 }
56 + (void)showSwitcher{
57 [[QSReg preferredProcessSwitcher]showSwitcher];
58 }
59
60 - (void)switchToNextApp{
61 [[QSReg preferredProcessSwitcher]switchToNextApp];
62 }
63 - (void)switchToPrevApp{
64 [[QSReg preferredProcessSwitcher]switchToPrevApp];
65 }
66 - (void)showSwitcher{
67 [[QSReg preferredProcessSwitcher]showSwitcher];
68 }
69 - (void)showSwitcherUnderMouse{
70 [[QSReg preferredProcessSwitcher]showSwitcherUnderMouse];
71 }
72
73 @end
74
75
76
77
Something went wrong with that request. Please try again.