aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNarrowDownCompletion.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-05-25 17:03:09 +0000
committerBibiko <bibiko@eva.mpg.de>2009-05-25 17:03:09 +0000
commit305cdbcd89744faad99133285d698ca867a0f1bb (patch)
treeddeed5ae93c1dd21679d6bc1d83776e629a54d4d /Source/SPNarrowDownCompletion.m
parent3cf01ebabf08ed5547f657869e4f453f6cb3f65a (diff)
downloadsequelpro-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 → ü
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r--Source/SPNarrowDownCompletion.m12
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;