aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/cocoa-srv.c
diff options
context:
space:
mode:
authorDavid Jeannot <djeannot24@gmail.com>2012-01-16 17:08:31 -0500
committerRuss Cox <rsc@swtch.com>2012-01-16 17:08:31 -0500
commit73b0f029e107c2d015ebb48d59d32f264973de49 (patch)
treeef10e405f62b1d7033cade6ab4c65776fd3bf480 /src/cmd/devdraw/cocoa-srv.c
parenta995f469b3e412ae39a57efa4472592a55248aac (diff)
downloadplan9port-73b0f029e107c2d015ebb48d59d32f264973de49.tar.gz
plan9port-73b0f029e107c2d015ebb48d59d32f264973de49.tar.bz2
plan9port-73b0f029e107c2d015ebb48d59d32f264973de49.zip
devdraw: fix handling of compose key on OS X
This implementation is simpler to understand. It removes conflicts with other modifiers and with the virtual buttons. Pressing alt during a sequence now cancels it correctly. R=rsc CC=plan9port.codebot http://codereview.appspot.com/5507049
Diffstat (limited to 'src/cmd/devdraw/cocoa-srv.c')
-rw-r--r--src/cmd/devdraw/cocoa-srv.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/devdraw/cocoa-srv.c b/src/cmd/devdraw/cocoa-srv.c
index ac6658ef..864aed7a 100644
--- a/src/cmd/devdraw/cocoa-srv.c
+++ b/src/cmd/devdraw/cocoa-srv.c
@@ -358,15 +358,25 @@ kputc(int c)
zunlock();
}
+static int alting;
+
+void
+abortcompose(void)
+{
+ if(alting)
+ keystroke(Kalt);
+}
+
void
keystroke(int c)
{
static Rune k[10];
- static int alting, nk;
+ static int nk;
int i;
if(c == Kalt){
alting = !alting;
+ nk = 0;
return;
}
if(!alting){