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
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user