aboutsummaryrefslogtreecommitdiffstats
path: root/cocoa.m
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-14 15:53:24 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-14 15:53:24 +0000
commit5cbfcd00b0822d9a1a69a65a2d6927f6c4142787 (patch)
treed85e7409bfa4c4b7a9251252c678dd90e70f240d /cocoa.m
parentec3757de320f5cc847fb51bff8bc99a9d264389d (diff)
cocoa monitor fix regarding the handling of dead keys (Joachim Henke)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1975 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cocoa.m')
-rw-r--r--cocoa.m47
1 files changed, 32 insertions, 15 deletions
diff --git a/cocoa.m b/cocoa.m
index 65f1fc324..9551affa3 100644
--- a/cocoa.m
+++ b/cocoa.m
@@ -439,23 +439,40 @@ static void cocoa_refresh(DisplayState *ds)
kbd_put_keycode(keycode & 0x7f); //remove e0 bit in front
/* handle monitor key events */
} else {
+ int keysym = 0;
+
switch([event keyCode]) {
- case 123:
- kbd_put_keysym(QEMU_KEY_LEFT);
- break;
- case 124:
- kbd_put_keysym(QEMU_KEY_RIGHT);
- break;
- case 125:
- kbd_put_keysym(QEMU_KEY_DOWN);
- break;
- case 126:
- kbd_put_keysym(QEMU_KEY_UP);
- break;
- default:
- kbd_put_keysym([[event characters] characterAtIndex:0]);
- break;
+ case 115:
+ keysym = QEMU_KEY_HOME;
+ break;
+ case 117:
+ keysym = QEMU_KEY_DELETE;
+ break;
+ case 119:
+ keysym = QEMU_KEY_END;
+ break;
+ case 123:
+ keysym = QEMU_KEY_LEFT;
+ break;
+ case 124:
+ keysym = QEMU_KEY_RIGHT;
+ break;
+ case 125:
+ keysym = QEMU_KEY_DOWN;
+ break;
+ case 126:
+ keysym = QEMU_KEY_UP;
+ break;
+ default:
+ {
+ NSString *ks = [event characters];
+
+ if ([ks length] > 0)
+ keysym = [ks characterAtIndex:0];
+ }
}
+ if (keysym)
+ kbd_put_keysym(keysym);
}
}
}