devdraw: OS X dead key support
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5503086
This commit is contained in:
parent
131ab3addb
commit
5ec2425b17
1 changed files with 19 additions and 0 deletions
|
|
@ -571,6 +571,23 @@ static int keycvt[] =
|
|||
[QZ_KP9] '9',
|
||||
};
|
||||
|
||||
@interface apptext : NSTextView @end
|
||||
|
||||
@implementation apptext
|
||||
- (void)doCommandBySelector:(SEL)s{} /* Esc key beeps otherwise */
|
||||
- (void)insertText:(id)arg{} /* to avoid a latency after some time */
|
||||
@end
|
||||
|
||||
static void
|
||||
interpretdeadkey(NSEvent *e)
|
||||
{
|
||||
static apptext *t;
|
||||
|
||||
if(t == nil)
|
||||
t = [apptext new];
|
||||
[t interpretKeyEvents:[NSArray arrayWithObject:e]];
|
||||
}
|
||||
|
||||
static void
|
||||
getkeyboard(NSEvent *e)
|
||||
{
|
||||
|
|
@ -588,6 +605,8 @@ getkeyboard(NSEvent *e)
|
|||
s = [e characters];
|
||||
c = [s UTF8String][0];
|
||||
|
||||
interpretdeadkey(e);
|
||||
|
||||
if(m & NSCommandKeyMask){
|
||||
if(' '<=c && c<='~')
|
||||
keystroke(Kcmd+c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue