aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-08-01 21:48:30 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-08-01 21:48:30 +0000
commit6fcfafb742459e29e29fd61ed174108064643915 (patch)
tree8d9e4c1a82fb0bf8c8c863b3c06d5bed35c38b60
parentaf8ffdfd2b3b0894a54cb6333217f9f3ae6eaa81 (diff)
console focus support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1032 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--console.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/console.c b/console.c
index b688e931cb..171d2a9379 100644
--- a/console.c
+++ b/console.c
@@ -599,6 +599,21 @@ static void console_chr_add_read_handler(CharDriverState *chr,
s->fd_opaque = opaque;
}
+static void console_send_event(CharDriverState *chr, int event)
+{
+ TextConsole *s = chr->opaque;
+ int i;
+
+ if (event == CHR_EVENT_FOCUS) {
+ for(i = 0; i < nb_consoles; i++) {
+ if (consoles[i] == s) {
+ console_select(i);
+ break;
+ }
+ }
+ }
+}
+
/* called when an ascii key is pressed */
void kbd_put_keysym(int keysym)
{
@@ -689,6 +704,8 @@ CharDriverState *text_console_init(DisplayState *ds)
chr->opaque = s;
chr->chr_write = console_puts;
chr->chr_add_read_handler = console_chr_add_read_handler;
+ chr->chr_send_event = console_send_event;
+
if (!color_inited) {
color_inited = 1;
for(i = 0; i < 8; i++) {