diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-12-04 12:53:44 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-03-05 09:52:03 +0100 |
commit | 2e08c665cccfcaa05e4a82b5a6a8865a6f42c340 (patch) | |
tree | a33981b302bab2cca330bdd0f18616e31138ece4 /ui | |
parent | c751a74afe07b82dbb968abd1eb45cd5163bd9f5 (diff) | |
download | qemu-2e08c665cccfcaa05e4a82b5a6a8865a6f42c340.tar.gz qemu-2e08c665cccfcaa05e4a82b5a6a8865a6f42c340.tar.bz2 qemu-2e08c665cccfcaa05e4a82b5a6a8865a6f42c340.zip |
input: keyboard: switch cocoa ui to new core
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/cocoa.m | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m index 866177770a..d4af3e5710 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -514,16 +514,14 @@ QemuCocoaView *cocoaView; if (keycode) { if (keycode == 58 || keycode == 69) { // emulate caps lock and num lock keydown and keyup - kbd_put_keycode(keycode); - kbd_put_keycode(keycode | 0x80); + qemu_input_event_send_key_number(dcl->con, keycode, true); + qemu_input_event_send_key_number(dcl->con, keycode, false); } else if (qemu_console_is_graphic(NULL)) { - if (keycode & 0x80) - kbd_put_keycode(0xe0); if (modifiers_state[keycode] == 0) { // keydown - kbd_put_keycode(keycode & 0x7f); + qemu_input_event_send_key_number(dcl->con, keycode, true); modifiers_state[keycode] = 1; } else { // keyup - kbd_put_keycode(keycode | 0x80); + qemu_input_event_send_key_number(dcl->con, keycode, false); modifiers_state[keycode] = 0; } } @@ -557,9 +555,7 @@ QemuCocoaView *cocoaView; // handle keys for graphic console } else if (qemu_console_is_graphic(NULL)) { - if (keycode & 0x80) //check bit for e0 in front - kbd_put_keycode(0xe0); - kbd_put_keycode(keycode & 0x7f); //remove e0 bit in front + qemu_input_event_send_key_number(dcl->con, keycode, true); // handlekeys for Monitor } else { @@ -607,9 +603,7 @@ QemuCocoaView *cocoaView; } if (qemu_console_is_graphic(NULL)) { - if (keycode & 0x80) - kbd_put_keycode(0xe0); - kbd_put_keycode(keycode | 0x80); //add 128 to signal release of key + qemu_input_event_send_key_number(dcl->con, keycode, false); } break; case NSMouseMoved: |