diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-05-25 17:03:09 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-05-25 17:03:09 +0000 |
commit | 305cdbcd89744faad99133285d698ca867a0f1bb (patch) | |
tree | ddeed5ae93c1dd21679d6bc1d83776e629a54d4d | |
parent | 3cf01ebabf08ed5547f657869e4f453f6cb3f65a (diff) | |
download | sequelpro-305cdbcd89744faad99133285d698ca867a0f1bb.tar.gz sequelpro-305cdbcd89744faad99133285d698ca867a0f1bb.tar.bz2 sequelpro-305cdbcd89744faad99133285d698ca867a0f1bb.zip |
• improved narrow-down completion
- allow to enter dead-keys or compounded accented chars via e.g. ⌘u + u → ü
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index cce6341a..e5dc43ea 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -354,7 +354,17 @@ { unsigned int flags = [event modifierFlags]; unichar key = [[event characters] length] == 1 ? [[event characters] characterAtIndex:0] : 0; - if((flags & NSControlKeyMask) || (flags & NSAlternateKeyMask) || (flags & NSCommandKeyMask)) + + // Check if user pressed ⌥ to allow composing of accented characters. + // e.g. for US keyboard "⌥u a" to insert ä + if (([event modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask)) == NSAlternateKeyMask || [[event characters] length] == 0) + { + [NSApp sendEvent: event]; + [mutablePrefix appendString:[event characters]]; + theCharRange = NSMakeRange(theCharRange.location, theCharRange.length+[[event characters] length]); + [self filter]; + } + else if((flags & NSControlKeyMask) || (flags & NSAlternateKeyMask) || (flags & NSCommandKeyMask)) { [NSApp sendEvent:event]; break; |