From: Joseph Spiros Date: Thu, 4 Sep 2003 01:36:01 +0000 (+0000) Subject: Adding HotKeys to ITKit... This is the new HotKey code by Quentin of X-Git-Tag: v0.1~39 X-Git-Url: http://git.ithinksw.org/ITKit.git/commitdiff_plain/d9649564199a7220e70716aa0999c6fddb0efadc Adding HotKeys to ITKit... This is the new HotKey code by Quentin of RogueAmoeba, added to ITKit with his permission. Also added support for non-modifier FKeys as global HotKeys. --- diff --git a/EffectSupport.txt b/EffectSupport.txt index d380500..ca86e87 100755 --- a/EffectSupport.txt +++ b/EffectSupport.txt @@ -1,4 +1,4 @@ -POSITIONS: +þÿPOSITIONS: +-------------------+ | A B C | @@ -32,4 +32,3 @@ Pos. | Possible Effects + = Maybe (Future) H | 0 1 2 - + I | 0 1 2 3 4 - diff --git a/English.lproj/ITKeyCodes.plist b/English.lproj/ITKeyCodes.plist new file mode 100755 index 0000000..40d44b6 --- /dev/null +++ b/English.lproj/ITKeyCodes.plist @@ -0,0 +1,103 @@ +{ + 0 = "A"; + 1 = "S"; + 2 = "D"; + 3 = "F"; + 4 = "H"; + 5 = "G"; + 6 = "Z"; + 7 = "X"; + 8 = "C"; + 9 = "V"; + 10 = "$"; + 11 = "B"; + 12 = "Q"; + 13 = "W"; + 14 = "E"; + 15 = "R"; + 16 = "Y"; + 17 = "T"; + 18 = "1"; + 19 = "2"; + 20 = "3"; + 21 = "4"; + 22 = "6"; + 23 = "5"; + 24 = "="; + 25 = "9"; + 26 = "7"; + 27 = "-"; + 28 = "8"; + 29 = "0"; + 30 = "\]"; + 31 = "O"; + 32 = "U"; + 33 = "\["; + 34 = "I"; + 35 = "P"; + 36 = "Return"; + 37 = "L"; + 38 = "J"; + 39 = "\'"; + 40 = "K"; + 41 = ";"; + 42 = "\\"; + 43 = ","; + 44 = "\/"; + 45 = "N"; + 46 = "M"; + 47 = "."; + 48 = "Tab"; + 49 = "Space"; + 50 = "\`"; + 51 = "Delete"; + 53 = "ESC"; + 55 = "Command"; + 56 = "Shift"; + 57 = "Caps Lock"; + 58 = "Option"; + 59 = "Control"; + 65 = "Pad ."; + 67 = "Pad *"; + 69 = "Pad +"; + 71 = "Clear"; + 75 = "Pad /"; + 76 = "Pad Enter"; + 78 = "Pad -"; + 81 = "Pad ="; + 82 = "Pad 0"; + 83 = "Pad 1"; + 84 = "Pad 2"; + 85 = "Pad 3"; + 86 = "Pad 4"; + 87 = "Pad 5"; + 88 = "Pad 6"; + 89 = "Pad 7"; + 91 = "Pad 8"; + 92 = "Pad 9"; + 96 = "F5"; + 97 = "F6"; + 98 = "F7"; + 99 = "F3"; + 100 = "F8"; + 101 = "F9"; + 103 = "F11"; + 105 = "F13"; + 107 = "F14"; + 109 = "F10"; + 111 = "F12"; + 113 = "F15"; + 114 = "Ins"; + 115 = "Home"; + 116 = "Page Up"; + 117 = "Del"; + 118 = "F4"; + 119 = "End"; + 120 = "F2"; + 121 = "Page Down"; + 122 = "F1"; + 123 = "Left Arrow"; + 124 = "Right Arrow"; + 125 = "Down Arrow"; + 126 = "Up Arrow"; +} \ No newline at end of file diff --git a/English.lproj/ITKeyComboPanel.nib/classes.nib b/English.lproj/ITKeyComboPanel.nib/classes.nib new file mode 100755 index 0000000..0ab0cc6 --- /dev/null +++ b/English.lproj/ITKeyComboPanel.nib/classes.nib @@ -0,0 +1,18 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = ITKeyBroadcaster; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, + { + ACTIONS = {cancel = id; clear = id; ok = id; }; + CLASS = ITKeyComboPanel; + LANGUAGE = ObjC; + OUTLETS = { + mComboField = NSTextField; + mKeyBcaster = ITKeyBroadcaster; + mTitleField = NSTextField; + }; + SUPERCLASS = NSWindowController; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/ITKeyComboPanel.nib/info.nib b/English.lproj/ITKeyComboPanel.nib/info.nib new file mode 100755 index 0000000..d6ed0ab --- /dev/null +++ b/English.lproj/ITKeyComboPanel.nib/info.nib @@ -0,0 +1,26 @@ + + + + + IBDocumentLocation + 109 47 356 240 0 0 1280 1002 + IBFramework Version + 291.0 + IBGroupedObjects + + 10 + + 22 + 27 + + + IBLastGroupID + 11 + IBOpenObjects + + 19 + + IBSystem Version + 6L60 + + diff --git a/English.lproj/ITKeyComboPanel.nib/objects.nib b/English.lproj/ITKeyComboPanel.nib/objects.nib new file mode 100755 index 0000000..570f426 Binary files /dev/null and b/English.lproj/ITKeyComboPanel.nib/objects.nib differ diff --git a/English.lproj/ITKeyComboPanel.nib/objects.nib~ b/English.lproj/ITKeyComboPanel.nib/objects.nib~ new file mode 100755 index 0000000..645b6c3 Binary files /dev/null and b/English.lproj/ITKeyComboPanel.nib/objects.nib~ differ diff --git a/English.lproj/Localizable.strings b/English.lproj/Localizable.strings new file mode 100755 index 0000000..57d9d74 --- /dev/null +++ b/English.lproj/Localizable.strings @@ -0,0 +1,75 @@ +/* AppleScript Error Alert */ +"%@\nFound at character index, length: %d, %d" = "%@\nFound at character index, length: %d, %d"; +"AppleScript Error %@" = "AppleScript Error %@"; + +/* File Size Abbrev. */ +"b" = "b"; +"GB" = "GB"; +"KB" = "KB"; +"MB" = "MB"; + +/* General Error Alert */ +"Details..." = "Details..."; +"Error" = "Error"; +"Exception Details" = "Exception Details"; +"Name: %@\nReason: %@\nStack Trace:\n%@\n\nInfo:\n%@\n" = "Name: %@\nReason: %@\nStack Trace:\n%@\n\nInfo:\n%@\n"; + +/* Hot Keys: Key Combo text for 'empty' combo */ +"(None)" = "(None)"; + +/* Isis: Alert Body */ +"The latest version of %@ is %@. Choose \"More Info\" to open a web page from which you can download or get information about this new version." = "The latest version of %@ is %@. Choose \"More Info\" to open a web page from which you can download or get information about this new version."; + +/* Isis: Alert Title */ +"A new version of %@ is now available." = "A new version of %@ is now available."; +"You're currently using the most up-to-date version of %@." = "You're currently using the most up-to-date version of %@."; + +/* Isis: Button */ +"Download now" = "Download now"; +"More Info..." = "More Info..."; +"Update Later" = "Update Later"; + +/* Isis: Error Msg */ +"Software Update Failed: Couldn't load remote version info" = "Software Update Failed: Couldn't load remote version info"; +"Software Update Failed: Failed to find bundle with given identifier" = "Software Update Failed: Failed to find bundle with given identifier"; + +/* Noise Alert + AppleScript Error Alert + General Error Alert + Trash Alert + Isis: Button */ +"OK" = "OK"; + +/* Noise Alert */ +"Do Not Adjust Your Speakers" = "Do Not Adjust Your Speakers"; +"Purchase" = "Purchase"; +"You are using an UNREGISTERED copy of %@. Because of this, the quality of the audio being hijacked will now begin deteriorating noticeably. Nothing is wrong with your speakers - you simply need to register to retain completely full-quality audio" = "You are using an UNREGISTERED copy of %@. Because of this, the quality of the audio being hijacked will now begin deteriorating noticeably. Nothing is wrong with your speakers - you simply need to register to retain completely full-quality audio"; + +/* Registration Status */ +"Be sure to enter your name and code exactly as they were sent to you." = "Be sure to enter your name and code exactly as they were sent to you."; +"Thanks for registering!" = "Thanks for registering!"; + +/* Timers: */ +"Everyday" = "Everyday"; +"Weekdays" = "Weekdays"; +"Weekends" = "Weekends"; + +/* Timers: Abbrev. */ +"Fr" = "Fr"; +"Mo" = "Mo"; +"Sa" = "Sa"; +"Su" = "Su"; +"Th" = "Th"; +"Tu" = "Tu"; +"We" = "We"; + +/* Timers: No Days Selected */ +"Never" = "Never"; + +/* Track Time Formatter: Time data is not avaliable */ +"N/A" = "N/A"; + +/* Trash Alert */ +"This copy of %@ appears to be in the Trash" = "This copy of %@ appears to be in the Trash"; +"You probably want to be running some other copy of %@, and not this one." = "You probably want to be running some other copy of %@, and not this one."; + diff --git a/French.lproj/ITKeyCodes.plist b/French.lproj/ITKeyCodes.plist new file mode 100755 index 0000000..40d44b6 --- /dev/null +++ b/French.lproj/ITKeyCodes.plist @@ -0,0 +1,103 @@ +{ + 0 = "A"; + 1 = "S"; + 2 = "D"; + 3 = "F"; + 4 = "H"; + 5 = "G"; + 6 = "Z"; + 7 = "X"; + 8 = "C"; + 9 = "V"; + 10 = "$"; + 11 = "B"; + 12 = "Q"; + 13 = "W"; + 14 = "E"; + 15 = "R"; + 16 = "Y"; + 17 = "T"; + 18 = "1"; + 19 = "2"; + 20 = "3"; + 21 = "4"; + 22 = "6"; + 23 = "5"; + 24 = "="; + 25 = "9"; + 26 = "7"; + 27 = "-"; + 28 = "8"; + 29 = "0"; + 30 = "\]"; + 31 = "O"; + 32 = "U"; + 33 = "\["; + 34 = "I"; + 35 = "P"; + 36 = "Return"; + 37 = "L"; + 38 = "J"; + 39 = "\'"; + 40 = "K"; + 41 = ";"; + 42 = "\\"; + 43 = ","; + 44 = "\/"; + 45 = "N"; + 46 = "M"; + 47 = "."; + 48 = "Tab"; + 49 = "Space"; + 50 = "\`"; + 51 = "Delete"; + 53 = "ESC"; + 55 = "Command"; + 56 = "Shift"; + 57 = "Caps Lock"; + 58 = "Option"; + 59 = "Control"; + 65 = "Pad ."; + 67 = "Pad *"; + 69 = "Pad +"; + 71 = "Clear"; + 75 = "Pad /"; + 76 = "Pad Enter"; + 78 = "Pad -"; + 81 = "Pad ="; + 82 = "Pad 0"; + 83 = "Pad 1"; + 84 = "Pad 2"; + 85 = "Pad 3"; + 86 = "Pad 4"; + 87 = "Pad 5"; + 88 = "Pad 6"; + 89 = "Pad 7"; + 91 = "Pad 8"; + 92 = "Pad 9"; + 96 = "F5"; + 97 = "F6"; + 98 = "F7"; + 99 = "F3"; + 100 = "F8"; + 101 = "F9"; + 103 = "F11"; + 105 = "F13"; + 107 = "F14"; + 109 = "F10"; + 111 = "F12"; + 113 = "F15"; + 114 = "Ins"; + 115 = "Home"; + 116 = "Page Up"; + 117 = "Del"; + 118 = "F4"; + 119 = "End"; + 120 = "F2"; + 121 = "Page Down"; + 122 = "F1"; + 123 = "Left Arrow"; + 124 = "Right Arrow"; + 125 = "Down Arrow"; + 126 = "Up Arrow"; +} \ No newline at end of file diff --git a/French.lproj/ITKeyComboPanel.nib/classes.nib b/French.lproj/ITKeyComboPanel.nib/classes.nib new file mode 100755 index 0000000..0ab0cc6 --- /dev/null +++ b/French.lproj/ITKeyComboPanel.nib/classes.nib @@ -0,0 +1,18 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = ITKeyBroadcaster; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, + { + ACTIONS = {cancel = id; clear = id; ok = id; }; + CLASS = ITKeyComboPanel; + LANGUAGE = ObjC; + OUTLETS = { + mComboField = NSTextField; + mKeyBcaster = ITKeyBroadcaster; + mTitleField = NSTextField; + }; + SUPERCLASS = NSWindowController; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/French.lproj/ITKeyComboPanel.nib/info.nib b/French.lproj/ITKeyComboPanel.nib/info.nib new file mode 100755 index 0000000..28d44b9 --- /dev/null +++ b/French.lproj/ITKeyComboPanel.nib/info.nib @@ -0,0 +1,26 @@ + + + + + IBDocumentLocation + 109 47 356 240 0 0 1280 1002 + IBFramework Version + 291.0 + IBGroupedObjects + + 11 + + 22 + 27 + + + IBLastGroupID + 12 + IBOpenObjects + + 19 + + IBSystem Version + 6L60 + + diff --git a/French.lproj/ITKeyComboPanel.nib/keyedobjects.nib b/French.lproj/ITKeyComboPanel.nib/keyedobjects.nib new file mode 100755 index 0000000..70e77b2 Binary files /dev/null and b/French.lproj/ITKeyComboPanel.nib/keyedobjects.nib differ diff --git a/French.lproj/ITKeyComboPanel.nib/keyedobjects.nib~ b/French.lproj/ITKeyComboPanel.nib/keyedobjects.nib~ new file mode 100755 index 0000000..682f3a9 Binary files /dev/null and b/French.lproj/ITKeyComboPanel.nib/keyedobjects.nib~ differ diff --git a/French.lproj/Localizable.strings b/French.lproj/Localizable.strings new file mode 100755 index 0000000..a0a322f Binary files /dev/null and b/French.lproj/Localizable.strings differ diff --git a/German.lproj/ITKeyCodes.plist b/German.lproj/ITKeyCodes.plist new file mode 100755 index 0000000..40d44b6 --- /dev/null +++ b/German.lproj/ITKeyCodes.plist @@ -0,0 +1,103 @@ +{ + 0 = "A"; + 1 = "S"; + 2 = "D"; + 3 = "F"; + 4 = "H"; + 5 = "G"; + 6 = "Z"; + 7 = "X"; + 8 = "C"; + 9 = "V"; + 10 = "$"; + 11 = "B"; + 12 = "Q"; + 13 = "W"; + 14 = "E"; + 15 = "R"; + 16 = "Y"; + 17 = "T"; + 18 = "1"; + 19 = "2"; + 20 = "3"; + 21 = "4"; + 22 = "6"; + 23 = "5"; + 24 = "="; + 25 = "9"; + 26 = "7"; + 27 = "-"; + 28 = "8"; + 29 = "0"; + 30 = "\]"; + 31 = "O"; + 32 = "U"; + 33 = "\["; + 34 = "I"; + 35 = "P"; + 36 = "Return"; + 37 = "L"; + 38 = "J"; + 39 = "\'"; + 40 = "K"; + 41 = ";"; + 42 = "\\"; + 43 = ","; + 44 = "\/"; + 45 = "N"; + 46 = "M"; + 47 = "."; + 48 = "Tab"; + 49 = "Space"; + 50 = "\`"; + 51 = "Delete"; + 53 = "ESC"; + 55 = "Command"; + 56 = "Shift"; + 57 = "Caps Lock"; + 58 = "Option"; + 59 = "Control"; + 65 = "Pad ."; + 67 = "Pad *"; + 69 = "Pad +"; + 71 = "Clear"; + 75 = "Pad /"; + 76 = "Pad Enter"; + 78 = "Pad -"; + 81 = "Pad ="; + 82 = "Pad 0"; + 83 = "Pad 1"; + 84 = "Pad 2"; + 85 = "Pad 3"; + 86 = "Pad 4"; + 87 = "Pad 5"; + 88 = "Pad 6"; + 89 = "Pad 7"; + 91 = "Pad 8"; + 92 = "Pad 9"; + 96 = "F5"; + 97 = "F6"; + 98 = "F7"; + 99 = "F3"; + 100 = "F8"; + 101 = "F9"; + 103 = "F11"; + 105 = "F13"; + 107 = "F14"; + 109 = "F10"; + 111 = "F12"; + 113 = "F15"; + 114 = "Ins"; + 115 = "Home"; + 116 = "Page Up"; + 117 = "Del"; + 118 = "F4"; + 119 = "End"; + 120 = "F2"; + 121 = "Page Down"; + 122 = "F1"; + 123 = "Left Arrow"; + 124 = "Right Arrow"; + 125 = "Down Arrow"; + 126 = "Up Arrow"; +} \ No newline at end of file diff --git a/German.lproj/ITKeyComboPanel.nib/classes.nib b/German.lproj/ITKeyComboPanel.nib/classes.nib new file mode 100755 index 0000000..0ab0cc6 --- /dev/null +++ b/German.lproj/ITKeyComboPanel.nib/classes.nib @@ -0,0 +1,18 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = ITKeyBroadcaster; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, + { + ACTIONS = {cancel = id; clear = id; ok = id; }; + CLASS = ITKeyComboPanel; + LANGUAGE = ObjC; + OUTLETS = { + mComboField = NSTextField; + mKeyBcaster = ITKeyBroadcaster; + mTitleField = NSTextField; + }; + SUPERCLASS = NSWindowController; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/German.lproj/ITKeyComboPanel.nib/info.nib b/German.lproj/ITKeyComboPanel.nib/info.nib new file mode 100755 index 0000000..b48acd3 --- /dev/null +++ b/German.lproj/ITKeyComboPanel.nib/info.nib @@ -0,0 +1,26 @@ + + + + + IBDocumentLocation + 79 31 356 240 0 0 1024 746 + IBFramework Version + 313.0 + IBGroupedObjects + + 10 + + 22 + 27 + + + IBLastGroupID + 11 + IBOpenObjects + + 19 + + IBSystem Version + 6L60 + + diff --git a/German.lproj/ITKeyComboPanel.nib/objects.nib b/German.lproj/ITKeyComboPanel.nib/objects.nib new file mode 100755 index 0000000..b88f646 Binary files /dev/null and b/German.lproj/ITKeyComboPanel.nib/objects.nib differ diff --git a/German.lproj/ITKeyComboPanel.nib/objects.nib~ b/German.lproj/ITKeyComboPanel.nib/objects.nib~ new file mode 100755 index 0000000..b8cc980 Binary files /dev/null and b/German.lproj/ITKeyComboPanel.nib/objects.nib~ differ diff --git a/German.lproj/Localizable.strings b/German.lproj/Localizable.strings new file mode 100755 index 0000000..0e7f77c --- /dev/null +++ b/German.lproj/Localizable.strings @@ -0,0 +1,39 @@ +"%@\nFound at character index, length: %d, %d" = "%@\nFound at character index, length: %d, %d"; +"(None)" = "(Keine)"; +"A new version of %@ is now available." = "Eine neue Version von%@ ist verf\U00fcgbar."; +"AppleScript Error %@" = "AppleScript Fehler %@"; +"Be sure to enter your name and code exactly as they were sent to you." = "Geben Sie Namen und Code exakt so ein, wie er Ihnen zugeschickt wurde."; +"Details..." = "Details..."; +"Do Not Adjust Your Speakers" = "Passen Sie nicht Ihre Lautsprecher an"; +"Download now" = "Jetzt herunterladen"; +Error = Fehler; +Everyday = "T\U00e4glich"; +"Exception Details" = Ausnahmedetails; +Fr = Fr; +GB = GB; +KB = KB; +MB = MB; +Mo = Mo; +"More Info..." = "Mehr Info..."; +"N/A" = "N/V"; +"Name: %@\nReason: %@\nStack Trace:\n%@\n\nInfo:\n%@\n" = "Name: %@\nReason: %@\nStack Trace:\n%@\n\nInfo:\n%@\n"; +Never = Nie; +OK = OK; +Purchase = Kaufen; +Sa = Sa; +"Software Update Failed: Couldn't load remote version info" = "Software Aktualisierung fehlgeschlagen: Konnte Remote Version nicht auslesen"; +"Software Update Failed: Failed to find bundle with given identifier" = "Software Aktualisierung fehlgeschlagen: Konnte Bundle mit \U00fcbermitteltem Identifier nicht finden"; +Su = So; +Th = Do; +"Thanks for registering!" = "Danke f\U00fcr die Registrierung"; +"The latest version of %@ is %@. Choose \"More Info\" to open a web page from which you can download or get information about this new version." = "Die letzte Version von %@ ist %@. W\U00e4hlen Sie \"Mehr Info\", um zu einer Webseite zu gelangen von der Sie diese Version herunterladen k\U00f6nnen."; +"This copy of %@ appears to be in the Trash" = "Diese Kopie von %@ scheint im Papierkorb zu liegen."; +Tu = Di; +"Update Later" = "Sp\U00e4ter aktualisieren"; +We = Mi; +Weekdays = Wochentags; +Weekends = "Am Wochenende"; +"You are using an UNREGISTERED copy of %@. Because of this, the quality of the audio being hijacked will now begin deteriorating noticeably. Nothing is wrong with your speakers - you simply need to register to retain completely full-quality audio" = "Sie benutzen eine UNREGISTRIERTE Version von %@. Deshalb wird sich die Qualit\U00e4t des \U00fcbernommenen Audiomaterials jetzt h\U00f6rbar verschlechtern. Ihre Lautsprecher sind in Ordnung - Sie m\U00fcssen nur die Software registrieren, um die volle Qualit\U00e4t zur\U00fcck zu bekommen."; +"You probably want to be running some other copy of %@, and not this one." = "Sie m\U00f6chten sicherlich eine andere Version von %@ laufen lassen und nicht diese."; +"You're currently using the most up-to-date version of %@." = "Sie benutzen zur Zeit die aktuellste Version von %@."; +b = B; diff --git a/Graphics/ITKeyboardIcon.tiff b/Graphics/ITKeyboardIcon.tiff new file mode 100755 index 0000000..b979bda Binary files /dev/null and b/Graphics/ITKeyboardIcon.tiff differ diff --git a/Graphics/URLTextViewHand.tiff b/Graphics/URLTextViewHand.tiff new file mode 100755 index 0000000..37a9783 Binary files /dev/null and b/Graphics/URLTextViewHand.tiff differ diff --git a/ITHotKey.h b/ITHotKey.h new file mode 100755 index 0000000..d654bbc --- /dev/null +++ b/ITHotKey.h @@ -0,0 +1,35 @@ +// +// ITHotKey.h +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import + +#import "ITKeyCombo.h" + +@interface ITHotKey : NSObject +{ + NSString* mName; + ITKeyCombo* mKeyCombo; + id mTarget; + SEL mAction; +} + +- (id)init; + +- (void)setName: (NSString*)name; +- (NSString*)name; + +- (void)setKeyCombo: (ITKeyCombo*)combo; +- (ITKeyCombo*)keyCombo; + +- (void)setTarget: (id)target; +- (id)target; +- (void)setAction: (SEL)action; +- (SEL)action; + +- (void)invoke; + +@end diff --git a/ITHotKey.m b/ITHotKey.m new file mode 100755 index 0000000..bf411f9 --- /dev/null +++ b/ITHotKey.m @@ -0,0 +1,91 @@ +// +// ITHotKey.m +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import "ITHotKey.h" + +#import "ITHotKeyCenter.h" +#import "ITKeyCombo.h" + +@implementation ITHotKey + +- (id)init +{ + self = [super init]; + + if( self ) + { + [self setKeyCombo: [ITKeyCombo clearKeyCombo]]; + } + + return self; +} + +- (void)dealloc +{ + [mName release]; + [mKeyCombo release]; + + [super dealloc]; +} + +- (NSString*)description +{ + return [NSString stringWithFormat: @"<%@: %@>", NSStringFromClass( [self class] ), [self keyCombo]]; +} + +#pragma mark - + +- (void)setKeyCombo: (ITKeyCombo*)combo +{ + [combo retain]; + [mKeyCombo release]; + mKeyCombo = combo; +} + +- (ITKeyCombo*)keyCombo +{ + return mKeyCombo; +} + +- (void)setName: (NSString*)name +{ + [name retain]; + [mName release]; + mName = name; +} + +- (NSString*)name +{ + return mName; +} + +- (void)setTarget: (id)target +{ + mTarget = target; +} + +- (id)target +{ + return mTarget; +} + +- (void)setAction: (SEL)action +{ + mAction = action; +} + +- (SEL)action +{ + return mAction; +} + +- (void)invoke +{ + [mTarget performSelector: mAction withObject: self]; +} + +@end diff --git a/ITHotKeyCenter.h b/ITHotKeyCenter.h new file mode 100755 index 0000000..e984bc5 --- /dev/null +++ b/ITHotKeyCenter.h @@ -0,0 +1,27 @@ +// +// ITHotKeyCenter.h +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import + +@class ITHotKey; + +@interface ITHotKeyCenter : NSObject +{ + NSMutableDictionary* mHotKeys; //Keys are NSValue of EventHotKeyRef + BOOL mEventHandlerInstalled; +} + ++ (id)sharedCenter; + +- (BOOL)registerHotKey: (ITHotKey*)hotKey; +- (void)unregisterHotKey: (ITHotKey*)hotKey; + +- (NSArray*)allHotKeys; + +- (void)sendEvent: (NSEvent*)event; + +@end diff --git a/ITHotKeyCenter.m b/ITHotKeyCenter.m new file mode 100755 index 0000000..ad9c31d --- /dev/null +++ b/ITHotKeyCenter.m @@ -0,0 +1,265 @@ +// +// ITHotKeyCenter.m +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import "ITHotKeyCenter.h" +#import "ITHotKey.h" +#import "ITKeyCombo.h" +#import + +#if __PROTEIN__ +#import "NSObjectAdditions.h" +#endif + +@interface ITHotKeyCenter (Private) +- (BOOL)_hasCarbonEventSupport; + +- (ITHotKey*)_hotKeyForCarbonHotKey: (EventHotKeyRef)carbonHotKey; +- (EventHotKeyRef)_carbonHotKeyForHotKey: (ITHotKey*)hotKey; + +- (void)_updateEventHandler; +- (void)_hotKeyDown: (ITHotKey*)hotKey; +- (void)_hotKeyUp: (ITHotKey*)hotKey; +static OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void* refCon ); +@end + +@implementation ITHotKeyCenter + +static id _sharedHotKeyCenter = nil; + ++ (id)sharedCenter +{ + if( _sharedHotKeyCenter == nil ) + { + _sharedHotKeyCenter = [[self alloc] init]; + #if __PROTEIN__ + [_sharedHotKeyCenter releaseOnTerminate]; + #endif + } + + return _sharedHotKeyCenter; +} + +- (id)init +{ + self = [super init]; + + if( self ) + { + mHotKeys = [[NSMutableDictionary alloc] init]; + } + + return self; +} + +- (void)dealloc +{ + [mHotKeys release]; + [super dealloc]; +} + +#pragma mark - + +- (BOOL)registerHotKey: (ITHotKey*)hotKey +{ + OSStatus err; + EventHotKeyID hotKeyID; + EventHotKeyRef carbonHotKey; + NSValue* key; + + if( [[self allHotKeys] containsObject: hotKey] == YES ) + [self unregisterHotKey: hotKey]; + + if( [[hotKey keyCombo] isValidHotKeyCombo] == NO ) + return YES; + + hotKeyID.signature = 'PTHk'; + hotKeyID.id = (long)hotKey; + + err = RegisterEventHotKey( [[hotKey keyCombo] keyCode], + [[hotKey keyCombo] modifiers], + hotKeyID, + GetEventDispatcherTarget(), + nil, + &carbonHotKey ); + + if( err ) + return NO; + + key = [NSValue valueWithPointer: carbonHotKey]; + [mHotKeys setObject: hotKey forKey: key]; + + [self _updateEventHandler]; + + return YES; +} + +- (void)unregisterHotKey: (ITHotKey*)hotKey +{ + OSStatus err; + EventHotKeyRef carbonHotKey; + NSValue* key; + + if( [[self allHotKeys] containsObject: hotKey] == NO ) + return; + + carbonHotKey = [self _carbonHotKeyForHotKey: hotKey]; + NSAssert( carbonHotKey != nil, @"" ); + + err = UnregisterEventHotKey( carbonHotKey ); + //Watch as we ignore 'err': + + key = [NSValue valueWithPointer: carbonHotKey]; + [mHotKeys removeObjectForKey: key]; + + [self _updateEventHandler]; + + //See that? Completely ignored +} + +- (NSArray*)allHotKeys +{ + return [mHotKeys allValues]; +} + +#pragma mark - + +- (BOOL)_hasCarbonEventSupport +{ + return floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_1; +} + +- (ITHotKey*)_hotKeyForCarbonHotKey: (EventHotKeyRef)carbonHotKey +{ + NSValue* key = [NSValue valueWithPointer: carbonHotKey]; + return [mHotKeys objectForKey: key]; +} + +- (EventHotKeyRef)_carbonHotKeyForHotKey: (ITHotKey*)hotKey +{ + NSArray* values; + NSValue* value; + + values = [mHotKeys allKeysForObject: hotKey]; + NSAssert( [values count] == 1, @"Failed to find Carbon Hotkey for ITHotKey" ); + + value = [values lastObject]; + + return (EventHotKeyRef)[value pointerValue]; +} + +- (void)_updateEventHandler +{ + if( [self _hasCarbonEventSupport] == NO ) //Don't use event handler on these systems + return; + + if( [mHotKeys count] && mEventHandlerInstalled == NO ) + { + EventTypeSpec eventSpec[2] = { + { kEventClassKeyboard, kEventHotKeyPressed }, + { kEventClassKeyboard, kEventHotKeyReleased } + }; + + InstallEventHandler( GetEventDispatcherTarget(), + (EventHandlerProcPtr)hotKeyEventHandler, + 2, eventSpec, nil, nil); + + mEventHandlerInstalled = YES; + } +} + +- (void)_hotKeyDown: (ITHotKey*)hotKey +{ + [hotKey invoke]; +} + +- (void)_hotKeyUp: (ITHotKey*)hotKey +{ +} + +- (void)sendEvent: (NSEvent*)event +{ + long subType; + EventHotKeyRef carbonHotKey; + + //We only have to intercept sendEvent to do hot keys on old system versions + if( [self _hasCarbonEventSupport] ) + return; + + if( [event type] == NSSystemDefined ) + { + subType = [event subtype]; + + if( subType == 6 ) //6 is hot key down + { + carbonHotKey= (EventHotKeyRef)[event data1]; //data1 is our hot key ref + if( carbonHotKey != nil ) + { + ITHotKey* hotKey = [self _hotKeyForCarbonHotKey: carbonHotKey]; + [self _hotKeyDown: hotKey]; + } + } + else if( subType == 9 ) //9 is hot key up + { + carbonHotKey= (EventHotKeyRef)[event data1]; + if( carbonHotKey != nil ) + { + ITHotKey* hotKey = [self _hotKeyForCarbonHotKey: carbonHotKey]; + [self _hotKeyUp: hotKey]; + } + } + } +} + +- (OSStatus)sendCarbonEvent: (EventRef)event +{ + OSStatus err; + EventHotKeyID hotKeyID; + ITHotKey* hotKey; + + NSAssert( [self _hasCarbonEventSupport], @"" ); + NSAssert( GetEventClass( event ) == kEventClassKeyboard, @"Unknown event class" ); + + err = GetEventParameter( event, + kEventParamDirectObject, + typeEventHotKeyID, + nil, + sizeof(EventHotKeyID), + nil, + &hotKeyID ); + if( err ) + return err; + + + NSAssert( hotKeyID.signature == 'PTHk', @"Invalid hot key id" ); + NSAssert( hotKeyID.id != nil, @"Invalid hot key id" ); + + hotKey = (ITHotKey*)hotKeyID.id; + + switch( GetEventKind( event ) ) + { + case kEventHotKeyPressed: + [self _hotKeyDown: hotKey]; + break; + + case kEventHotKeyReleased: + [self _hotKeyUp: hotKey]; + break; + + default: + NSAssert( 0, @"Unknown event kind" ); + break; + } + + return noErr; +} + +static OSStatus hotKeyEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void* refCon ) +{ + return [[ITHotKeyCenter sharedCenter] sendCarbonEvent: inEvent]; +} + +@end diff --git a/ITKeyBroadcaster.h b/ITKeyBroadcaster.h new file mode 100755 index 0000000..9e30ed4 --- /dev/null +++ b/ITKeyBroadcaster.h @@ -0,0 +1,19 @@ +// +// ITKeyBroadcaster.h +// +// Created by Quentin Carnicelli on Sun Aug 03 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import + + +@interface ITKeyBroadcaster : NSButton +{ +} + ++ (long)cocoaModifiersAsCarbonModifiers: (long)cocoaModifiers; + +@end + +__private_extern__ NSString* ITKeyBroadcasterKeyEvent; //keys: keyCombo as ITKeyCombo \ No newline at end of file diff --git a/ITKeyBroadcaster.m b/ITKeyBroadcaster.m new file mode 100755 index 0000000..b09ea9a --- /dev/null +++ b/ITKeyBroadcaster.m @@ -0,0 +1,73 @@ +// +// ITKeyBroadcaster.m +// +// Created by Quentin Carnicelli on Sun Aug 03 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import "ITKeyBroadcaster.h" +#import "ITKeyCombo.h" +#import + +NSString* ITKeyBroadcasterKeyEvent = @"ITKeyBroadcasterKeyEvent"; + +@implementation ITKeyBroadcaster + +- (void)_bcastKeyCode: (short)keyCode modifiers: (long)modifiers +{ + ITKeyCombo* keyCombo = [ITKeyCombo keyComboWithKeyCode: keyCode modifiers: modifiers]; + NSDictionary* userInfo = [NSDictionary dictionaryWithObject: keyCombo forKey:@"keyCombo"]; + + [[NSNotificationCenter defaultCenter] + postNotificationName: ITKeyBroadcasterKeyEvent + object: self + userInfo: userInfo]; +} + +- (void)_bcastEvent: (NSEvent*)event +{ + short keyCode; + long modifiers; + + keyCode = [event keyCode]; + modifiers = [event modifierFlags]; + modifiers = [[self class] cocoaModifiersAsCarbonModifiers: modifiers]; + + [self _bcastKeyCode: keyCode modifiers: modifiers]; +} + +- (void)keyDown: (NSEvent*)event +{ + [self _bcastEvent: event]; +} + +- (BOOL)performKeyEquivalent: (NSEvent*)event +{ + [self _bcastEvent: event]; + return YES; +} + ++ (long)cocoaModifiersAsCarbonModifiers: (long)cocoaModifiers +{ + static long cocoaToCarbon[6][2] = + { + { NSCommandKeyMask, cmdKey}, + { NSAlternateKeyMask, optionKey}, + { NSControlKeyMask, controlKey}, + { NSShiftKeyMask, shiftKey}, + { NSFunctionKeyMask, rightControlKey}, + //{ NSAlphaShiftKeyMask, alphaLock }, //Ignore this? + }; + + long carbonModifiers = 0; + int i; + + for( i = 0 ; i < 6; i++ ) + if( cocoaModifiers & cocoaToCarbon[i][0] ) + carbonModifiers += cocoaToCarbon[i][1]; + + return carbonModifiers; +} + + +@end diff --git a/ITKeyCombo.h b/ITKeyCombo.h new file mode 100755 index 0000000..e6d1be0 --- /dev/null +++ b/ITKeyCombo.h @@ -0,0 +1,38 @@ +// +// ITKeyCombo.h +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import + + +@interface ITKeyCombo : NSObject +{ + int mKeyCode; + int mModifiers; +} + ++ (id)clearKeyCombo; ++ (id)keyComboWithKeyCode: (int)keyCode modifiers: (int)modifiers; +- (id)initWithKeyCode: (int)keyCode modifiers: (int)modifiers; + +- (id)initWithPlistRepresentation: (id)plist; +- (id)plistRepresentation; + +- (BOOL)isEqual: (ITKeyCombo*)combo; + +- (int)keyCode; +- (int)modifiers; + +- (BOOL)isClearCombo; +- (BOOL)isValidHotKeyCombo; + +@end + +@interface ITKeyCombo (UserDisplayAdditions) + +- (NSString*)description; + +@end \ No newline at end of file diff --git a/ITKeyCombo.m b/ITKeyCombo.m new file mode 100755 index 0000000..1a70528 --- /dev/null +++ b/ITKeyCombo.m @@ -0,0 +1,177 @@ +// +// ITKeyCombo.m +// +// Created by Quentin Carnicelli on Sat Aug 02 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import "ITKeyCombo.h" + +#import + +@implementation ITKeyCombo + ++ (id)clearKeyCombo +{ + return [self keyComboWithKeyCode: -1 modifiers: -1]; +} + ++ (id)keyComboWithKeyCode: (int)keyCode modifiers: (int)modifiers +{ + return [[[self alloc] initWithKeyCode: keyCode modifiers: modifiers] autorelease]; +} + +- (id)initWithKeyCode: (int)keyCode modifiers: (int)modifiers +{ + self = [super init]; + + if( self ) + { + mKeyCode = keyCode; + mModifiers = modifiers; + } + + return self; +} + +- (id)initWithPlistRepresentation: (id)plist +{ + int keyCode, modifiers; + + keyCode = [[plist objectForKey: @"keyCode"] intValue]; + if( keyCode <= 0 ) keyCode = -1; + + modifiers = [[plist objectForKey: @"modifiers"] intValue]; + if( modifiers <= 0 ) modifiers = -1; + + return [self initWithKeyCode: keyCode modifiers: modifiers]; +} + +- (id)plistRepresentation +{ + return [NSDictionary dictionaryWithObjectsAndKeys: + [NSNumber numberWithInt: [self keyCode]], @"keyCode", + [NSNumber numberWithInt: [self modifiers]], @"modifiers", + nil]; +} + +- (id)copyWithZone:(NSZone*)zone; +{ + return [self retain]; +} + +- (BOOL)isEqual: (ITKeyCombo*)combo +{ + return [self keyCode] == [combo keyCode] && + [self modifiers] == [combo modifiers]; +} + +#pragma mark - + +- (int)keyCode +{ + return mKeyCode; +} + +- (int)modifiers +{ + return mModifiers; +} + +- (BOOL)isValidHotKeyCombo +{ + return mKeyCode >= 0 && mModifiers > 0; +} + +- (BOOL)isClearCombo +{ + return mKeyCode == -1 && mModifiers == -1; +} + +@end + +#pragma mark - + +@implementation ITKeyCombo (UserDisplayAdditions) + ++ (NSDictionary*)_keyCodesDictionary +{ + static NSDictionary* keyCodes = nil; + + if( keyCodes == nil ) + { + NSString* path; + NSString* contents; + + path = [[NSBundle bundleForClass: self] pathForResource: @"ITKeyCodes" ofType: @"plist"]; + contents = [NSString stringWithContentsOfFile: path]; + keyCodes = [[contents propertyList] retain]; + } + + return keyCodes; +} + ++ (NSString*)_stringForModifiers: (long)modifiers +{ + static long modToChar[4][2] = + { + { cmdKey, 0x23180000 }, + { optionKey, 0x23250000 }, + { controlKey, 0x005E0000 }, + { shiftKey, 0x21e70000 } + }; + + NSString* str = nil; + NSString* charStr; + long i; + + str = [NSString string]; + + for( i = 0; i < 4; i++ ) + { + if( modifiers & modToChar[i][0] ) + { + charStr = [NSString stringWithCharacters: (const unichar*)&modToChar[i][1] length: 1]; + str = [str stringByAppendingString: charStr]; + } + } + + if( !str ) + str = @""; + + return str; +} + ++ (NSString*)_stringForKeyCode: (short)keyCode +{ + NSDictionary* dict; + id key; + NSString* str; + + dict = [self _keyCodesDictionary]; + key = [NSString stringWithFormat: @"%d", keyCode]; + str = [dict objectForKey: key]; + + if( !str ) + str = [NSString stringWithFormat: @"%X", keyCode]; + + return str; +} + +- (NSString*)description +{ + NSString* desc; + + if( [self isValidHotKeyCombo] ) //This might have to change + { + desc = [NSString stringWithFormat: @"%@%@", + [[self class] _stringForModifiers: [self modifiers]], + [[self class] _stringForKeyCode: [self keyCode]]]; + } + else + desc = NSLocalizedString( @"(None)", @"Hot Keys: Key Combo text for 'empty' combo" ); + + return desc; +} + +@end \ No newline at end of file diff --git a/ITKeyComboPanel.h b/ITKeyComboPanel.h new file mode 100755 index 0000000..fbe18aa --- /dev/null +++ b/ITKeyComboPanel.h @@ -0,0 +1,40 @@ +// +// ITKeyComboPanel.h + +// +// Created by Quentin Carnicelli on Sun Aug 03 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import + +@class ITKeyBroadcaster; +@class ITKeyCombo; +@class ITHotKey; + +@interface ITKeyComboPanel : NSWindowController +{ + IBOutlet NSTextField* mTitleField; + IBOutlet NSTextField* mComboField; + IBOutlet ITKeyBroadcaster* mKeyBcaster; + + NSString* mTitleFormat; + NSString* mKeyName; + ITKeyCombo* mKeyCombo; +} + ++ (id)sharedPanel; + +- (int)runModal; +- (void)runModalForHotKey: (ITHotKey*)hotKey; + +- (void)setKeyCombo: (ITKeyCombo*)combo; +- (ITKeyCombo*)keyCombo; + +- (void)setKeyBindingName: (NSString*)name; +- (NSString*)keyBindingName; + +- (IBAction)ok: (id)sender; +- (IBAction)cancel: (id)sender; +- (IBAction)clear: (id)sender; +@end diff --git a/ITKeyComboPanel.m b/ITKeyComboPanel.m new file mode 100755 index 0000000..e10ffc0 --- /dev/null +++ b/ITKeyComboPanel.m @@ -0,0 +1,157 @@ +// +// ITKeyComboPanel.m +// +// Created by Quentin Carnicelli on Sun Aug 03 2003. +// Copyright (c) 2003 iThink Software. All rights reserved. +// + +#import "ITKeyComboPanel.h" + +#import "ITHotKey.h" +#import "ITKeyCombo.h" +#import "ITKeyBroadcaster.h" +#import "ITHotKeyCenter.h" + +#if __PROTEIN__ +#import "NSObjectAdditions.h" +#endif + +@implementation ITKeyComboPanel + +static id _sharedKeyComboPanel = nil; + ++ (id)sharedPanel +{ + if( _sharedKeyComboPanel == nil ) + { + _sharedKeyComboPanel = [[self alloc] init]; + + #if __PROTEIN__ + [_sharedKeyComboPanel releaseOnTerminate]; + #endif + } + + return _sharedKeyComboPanel; +} + +- (id)init +{ + return [self initWithWindowNibName: @"ITKeyComboPanel"]; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver: self]; + [mKeyName release]; + [mTitleFormat release]; + + [super dealloc]; +} + +- (void)windowDidLoad +{ + mTitleFormat = [[mTitleField stringValue] retain]; + + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector( noteKeyBroadcast: ) + name: ITKeyBroadcasterKeyEvent + object: mKeyBcaster]; +} + +- (void)_refreshContents +{ + if( mComboField ) + [mComboField setStringValue: [mKeyCombo description]]; + + if( mTitleField ) + [mTitleField setStringValue: [NSString stringWithFormat: mTitleFormat, mKeyName]]; +} + +- (int)runModal +{ + int resultCode; + + [self window]; //Force us to load + + [self _refreshContents]; + [[self window] center]; + [self showWindow: self]; + resultCode = [[NSApplication sharedApplication] runModalForWindow: [self window]]; + [self close]; + + return resultCode; +} + +- (void)runModalForHotKey: (ITHotKey*)hotKey +{ + int resultCode; + + [self setKeyBindingName: [hotKey name]]; + [self setKeyCombo: [hotKey keyCombo]]; + + resultCode = [self runModal]; + + if( resultCode == NSOKButton ) + { + [hotKey setKeyCombo: [self keyCombo]]; + [[ITHotKeyCenter sharedCenter] registerHotKey: hotKey]; + } +} + +#pragma mark - + +- (void)setKeyCombo: (ITKeyCombo*)combo +{ + [combo retain]; + [mKeyCombo release]; + mKeyCombo = combo; + [self _refreshContents]; +} + +- (ITKeyCombo*)keyCombo +{ + return mKeyCombo; +} + +- (void)setKeyBindingName: (NSString*)name +{ + [name retain]; + [mKeyName release]; + mKeyName = name; + [self _refreshContents]; +} + +- (NSString*)keyBindingName +{ + return mKeyName; +} + +#pragma mark - + +- (IBAction)ok: (id)sender +{ + [[NSApplication sharedApplication] stopModalWithCode: NSOKButton]; +} + +- (IBAction)cancel: (id)sender +{ + [[NSApplication sharedApplication] stopModalWithCode: NSCancelButton]; +} + +- (IBAction)clear: (id)sender +{ + [self setKeyCombo: [ITKeyCombo clearKeyCombo]]; + [[NSApplication sharedApplication] stopModalWithCode: NSOKButton]; +} + +- (void)noteKeyBroadcast: (NSNotification*)note +{ + ITKeyCombo* keyCombo; + + keyCombo = [[note userInfo] objectForKey: @"keyCombo"]; + + [self setKeyCombo: keyCombo]; +} + +@end diff --git a/ITKit.h b/ITKit.h index 5b8f165..8279c53 100755 --- a/ITKit.h +++ b/ITKit.h @@ -13,6 +13,11 @@ #import +#import +#import +#import +#import +#import #import #import #import diff --git a/Japanese.lproj/ITKeyCodes.plist b/Japanese.lproj/ITKeyCodes.plist new file mode 100755 index 0000000..40d44b6 --- /dev/null +++ b/Japanese.lproj/ITKeyCodes.plist @@ -0,0 +1,103 @@ +{ + 0 = "A"; + 1 = "S"; + 2 = "D"; + 3 = "F"; + 4 = "H"; + 5 = "G"; + 6 = "Z"; + 7 = "X"; + 8 = "C"; + 9 = "V"; + 10 = "$"; + 11 = "B"; + 12 = "Q"; + 13 = "W"; + 14 = "E"; + 15 = "R"; + 16 = "Y"; + 17 = "T"; + 18 = "1"; + 19 = "2"; + 20 = "3"; + 21 = "4"; + 22 = "6"; + 23 = "5"; + 24 = "="; + 25 = "9"; + 26 = "7"; + 27 = "-"; + 28 = "8"; + 29 = "0"; + 30 = "\]"; + 31 = "O"; + 32 = "U"; + 33 = "\["; + 34 = "I"; + 35 = "P"; + 36 = "Return"; + 37 = "L"; + 38 = "J"; + 39 = "\'"; + 40 = "K"; + 41 = ";"; + 42 = "\\"; + 43 = ","; + 44 = "\/"; + 45 = "N"; + 46 = "M"; + 47 = "."; + 48 = "Tab"; + 49 = "Space"; + 50 = "\`"; + 51 = "Delete"; + 53 = "ESC"; + 55 = "Command"; + 56 = "Shift"; + 57 = "Caps Lock"; + 58 = "Option"; + 59 = "Control"; + 65 = "Pad ."; + 67 = "Pad *"; + 69 = "Pad +"; + 71 = "Clear"; + 75 = "Pad /"; + 76 = "Pad Enter"; + 78 = "Pad -"; + 81 = "Pad ="; + 82 = "Pad 0"; + 83 = "Pad 1"; + 84 = "Pad 2"; + 85 = "Pad 3"; + 86 = "Pad 4"; + 87 = "Pad 5"; + 88 = "Pad 6"; + 89 = "Pad 7"; + 91 = "Pad 8"; + 92 = "Pad 9"; + 96 = "F5"; + 97 = "F6"; + 98 = "F7"; + 99 = "F3"; + 100 = "F8"; + 101 = "F9"; + 103 = "F11"; + 105 = "F13"; + 107 = "F14"; + 109 = "F10"; + 111 = "F12"; + 113 = "F15"; + 114 = "Ins"; + 115 = "Home"; + 116 = "Page Up"; + 117 = "Del"; + 118 = "F4"; + 119 = "End"; + 120 = "F2"; + 121 = "Page Down"; + 122 = "F1"; + 123 = "Left Arrow"; + 124 = "Right Arrow"; + 125 = "Down Arrow"; + 126 = "Up Arrow"; +} \ No newline at end of file diff --git a/Japanese.lproj/ITKeyComboPanel.nib/classes.nib b/Japanese.lproj/ITKeyComboPanel.nib/classes.nib new file mode 100755 index 0000000..0ab0cc6 --- /dev/null +++ b/Japanese.lproj/ITKeyComboPanel.nib/classes.nib @@ -0,0 +1,18 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = ITKeyBroadcaster; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, + { + ACTIONS = {cancel = id; clear = id; ok = id; }; + CLASS = ITKeyComboPanel; + LANGUAGE = ObjC; + OUTLETS = { + mComboField = NSTextField; + mKeyBcaster = ITKeyBroadcaster; + mTitleField = NSTextField; + }; + SUPERCLASS = NSWindowController; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/Japanese.lproj/ITKeyComboPanel.nib/info.nib b/Japanese.lproj/ITKeyComboPanel.nib/info.nib new file mode 100755 index 0000000..d6ed0ab --- /dev/null +++ b/Japanese.lproj/ITKeyComboPanel.nib/info.nib @@ -0,0 +1,26 @@ + + + + + IBDocumentLocation + 109 47 356 240 0 0 1280 1002 + IBFramework Version + 291.0 + IBGroupedObjects + + 10 + + 22 + 27 + + + IBLastGroupID + 11 + IBOpenObjects + + 19 + + IBSystem Version + 6L60 + + diff --git a/Japanese.lproj/ITKeyComboPanel.nib/objects.nib b/Japanese.lproj/ITKeyComboPanel.nib/objects.nib new file mode 100755 index 0000000..570f426 Binary files /dev/null and b/Japanese.lproj/ITKeyComboPanel.nib/objects.nib differ diff --git a/Japanese.lproj/Localizable.strings b/Japanese.lproj/Localizable.strings new file mode 100755 index 0000000..96d8bbd Binary files /dev/null and b/Japanese.lproj/Localizable.strings differ diff --git a/Showcase/English.lproj/InfoPlist.strings b/Showcase/English.lproj/InfoPlist.strings index e5fc941..b71aeb8 100755 Binary files a/Showcase/English.lproj/InfoPlist.strings and b/Showcase/English.lproj/InfoPlist.strings differ diff --git a/Showcase/main.m b/Showcase/main.m index 20ec715..97f31ac 100755 --- a/Showcase/main.m +++ b/Showcase/main.m @@ -3,7 +3,7 @@ // ITKitTester // // Created by Matt L. Judy on Sat Dec 07 2002. -// Copyright (c) 2002 NibFile.com. All rights reserved. +// Copyright (c) 2002 iThink Software. All rights reserved. // #import