Changeset 431 for trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEKeyEquivalents.m
- Timestamp:
- 03/03/08 08:21:22 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEKeyEquivalents.m
r319 r431 140 140 return keyEquivalentAttributedString; 141 141 } 142 143 // converts NSUserKeyEquivalents prefixes into modifier flags 144 NSAttributedString *ICCF_KeyEquivalentAttributedString(NSString *self, unsigned count) { 145 unsigned modifierFlags = 0; 146 int i; 147 for (i = 0 ; i < [self length] - 1; i++) { 148 switch ([self characterAtIndex: i]) { 149 case '@': modifierFlags |= NSCommandKeyMask; break; 150 case '~': modifierFlags |= NSAlternateKeyMask; break; 151 case '^': modifierFlags |= NSControlKeyMask; break; 152 case '$': modifierFlags |= NSShiftKeyMask; break; 153 default: 154 return nil; 155 } 156 } 157 return ICCF_KeyEquivalentAttributedStringWithModifierFlags([self substringFromIndex: i], modifierFlags, count); 158 } 159
Note:
See TracChangeset
for help on using the changeset viewer.