Commit 7c206a75 authored by bellard's avatar bellard
Browse files

(Joachim Henke)

- suppress unwanted kernel logs
- avoids passing modifier keys to the guest OS when typing in the Monitor
- fixes the bug that the mouse cursor grab is released with _any_ modifier key
  (should be only ctrl+alt)
- removes some code redundancies


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1721 c046a42c-6fe2-441c-8c8c-71466251a162
parent 2efc3265
......@@ -375,36 +375,39 @@ static void cocoa_refresh(DisplayState *ds)
case NSFlagsChanged:
{
int keycode = cocoa_keycode_to_qemu([event keyCode]);
modifiers_state[keycode] = (modifiers_state[keycode] == 0) ? 1 : 0;
if ( modifiers_state[keycode] ) { /* Keydown */
if (keycode & 0x80)
kbd_put_keycode(0xe0);
kbd_put_keycode(keycode & 0x7f);
} else { /* Keyup */
if (keycode & 0x80)
kbd_put_keycode(0xe0);
kbd_put_keycode(keycode | 0x80);
}
/* emulate caps lock and num lock keyup */
if ((keycode == 58) || (keycode == 69))
if (keycode)
{
modifiers_state[keycode] = 0;
if (keycode & 0x80)
kbd_put_keycode(0xe0);
kbd_put_keycode(keycode | 0x80);
if (keycode == 58 || keycode == 69) {
/* emulate caps lock and num lock keydown and keyup */
kbd_put_keycode(keycode);
kbd_put_keycode(keycode | 0x80);
} else if (is_active_console(vga_console)) {
if (keycode & 0x80)
kbd_put_keycode(0xe0);
if (modifiers_state[keycode] == 0) {
/* keydown */
kbd_put_keycode(keycode & 0x7f);
modifiers_state[keycode] = 1;
} else {
/* keyup */
kbd_put_keycode(keycode | 0x80);
modifiers_state[keycode] = 0;
}
}
}
/* release Mouse grab when pressing ctrl+alt */
if (([event modifierFlags] & NSControlKeyMask) && ([event modifierFlags] & NSAlternateKeyMask))
{
[window setTitle: @"QEMU"];
[NSCursor unhide];
CGAssociateMouseAndMouseCursorPosition ( TRUE );
grab = 0;
}
}
break;
case NSKeyDown:
{
int keycode = cocoa_keycode_to_qemu([event keyCode]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment