From nobody Sun Jan 5 02:56:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17304919314611023.6991859131509; Fri, 1 Nov 2024 13:12:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6xzW-0007v9-PK; Fri, 01 Nov 2024 16:11:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6xzU-0007uj-Ob for qemu-devel@nongnu.org; Fri, 01 Nov 2024 16:11:28 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6xzS-0008EU-IK for qemu-devel@nongnu.org; Fri, 01 Nov 2024 16:11:28 -0400 Received: from [2a00:23c4:8bb8:f600:91a1:336d:3931:745] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t6xz4-0002Im-CS; Fri, 01 Nov 2024 20:11:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=537/m7QUoMo16LmOnBut+7WE90yoPRq5PTpo94fnIOI=; b=Amt0E6SbYGrOyJjUCWHbhZ2ofD 8Ju2eYlOouqe9NYGf+PjsHH92aNllp28LSMEMZynYqTM0g2wuK+zlqYZ7tyy1ftr7wzT7J4fLWfBt SKH4WAEPOVAKprVYhkQwfsF22n+smhCg+WPwoVkE1UFefbKohUQwhOGWnPdFRD0xOYoSUZvq+eXYN QNk17H/Ye2pQ3absXsN/tcX+mmD6oLpXIIQFb9qmz0VXpZk2D1kyulcPoOkoYnnp22ilKczpUYSvS wc8fgcq2ijQSmtQaFeJpt1yK4/qVfPBFPG2leoCuDQU9JFbS/jA1/fewsOCxxgQGh53iBKHbRY0hR gHERWa/iMXk+MREaKrQBCJEayinLn6sDgSJtNT5vTyCrXDuQdo1HYkGea39lNymQ81hpRYyx3mb+B dEKpOdrPR6cBK8dxYvcrlglHCRROyTqmZiGV4zYZnSR9f1D18Najzox36gowpgeXIeClCqEzM5xZU xHqPGuBwhXaVBHa5AmFn37v3CJ6415XS4JueaFXA5zLdVQEJk1EJ1WA2PvjPv79HC2J2u8PsfiI0P voBVp8rX3K+yIKlCELzxAah1cZY+jAhciy5NJV3fhAoShfeuPFm0Hn3V6ZOYp3l335JKNNsyuykGF 6K6jueSpWWr4fTFyAZxqhOHsTG1CWvS29OQSARtT8=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, huth@tuxfamily.org, qemu-devel@nongnu.org Date: Fri, 1 Nov 2024 20:11:05 +0000 Message-Id: <20241101201106.1432336-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241101201106.1432336-1-mark.cave-ayland@ilande.co.uk> References: <20241101201106.1432336-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb8:f600:91a1:336d:3931:745 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 1/2] next-kbd: convert to use qemu_input_handler_register() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1730491933967116600 Content-Type: text/plain; charset="utf-8" Convert the next-kbd device from the legacy UI qemu_add_kbd_event_handler() function to use qemu_input_handler_register(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth --- hw/m68k/next-kbd.c | 166 ++++++++++++++++++++++++++++++--------------- 1 file changed, 111 insertions(+), 55 deletions(-) diff --git a/hw/m68k/next-kbd.c b/hw/m68k/next-kbd.c index bc67810f31..283e98e9eb 100644 --- a/hw/m68k/next-kbd.c +++ b/hw/m68k/next-kbd.c @@ -68,7 +68,6 @@ struct NextKBDState { uint16_t shift; }; =20 -static void queue_code(void *opaque, int code); =20 /* lots of magic numbers here */ static uint32_t kbd_read_byte(void *opaque, hwaddr addr) @@ -166,68 +165,79 @@ static const MemoryRegionOps kbd_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 -static void nextkbd_event(void *opaque, int ch) -{ - /* - * Will want to set vars for caps/num lock - * if (ch & 0x80) -> key release - * there's also e0 escaped scancodes that might need to be handled - */ - queue_code(opaque, ch); -} - -static const unsigned char next_keycodes[128] =3D { - 0x00, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x50, 0x4F, - 0x4E, 0x1E, 0x1F, 0x20, 0x1D, 0x1C, 0x1B, 0x00, - 0x42, 0x43, 0x44, 0x45, 0x48, 0x47, 0x46, 0x06, - 0x07, 0x08, 0x00, 0x00, 0x2A, 0x00, 0x39, 0x3A, - 0x3B, 0x3C, 0x3D, 0x40, 0x3F, 0x3E, 0x2D, 0x2C, - 0x2B, 0x26, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, - 0x35, 0x37, 0x36, 0x2e, 0x2f, 0x30, 0x00, 0x00, - 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define NEXTKBD_NO_KEY 0xff + +static const int qcode_to_nextkbd_keycode[] =3D { + /* Make sure future additions are automatically set to NEXTKBD_NO_KEY = */ + [0 ... Q_KEY_CODE__MAX] =3D NEXTKBD_NO_KEY, + + [Q_KEY_CODE_ESC] =3D 0x49, + [Q_KEY_CODE_1] =3D 0x4a, + [Q_KEY_CODE_2] =3D 0x4b, + [Q_KEY_CODE_3] =3D 0x4c, + [Q_KEY_CODE_4] =3D 0x4d, + [Q_KEY_CODE_5] =3D 0x50, + [Q_KEY_CODE_6] =3D 0x4f, + [Q_KEY_CODE_7] =3D 0x4e, + [Q_KEY_CODE_8] =3D 0x1e, + [Q_KEY_CODE_9] =3D 0x1f, + [Q_KEY_CODE_0] =3D 0x20, + [Q_KEY_CODE_MINUS] =3D 0x1d, + [Q_KEY_CODE_EQUAL] =3D 0x1c, + [Q_KEY_CODE_BACKSPACE] =3D 0x1b, + [Q_KEY_CODE_TAB] =3D 0x00, + + [Q_KEY_CODE_Q] =3D 0x42, + [Q_KEY_CODE_W] =3D 0x43, + [Q_KEY_CODE_E] =3D 0x44, + [Q_KEY_CODE_R] =3D 0x45, + [Q_KEY_CODE_T] =3D 0x48, + [Q_KEY_CODE_Y] =3D 0x47, + [Q_KEY_CODE_U] =3D 0x46, + [Q_KEY_CODE_I] =3D 0x06, + [Q_KEY_CODE_O] =3D 0x07, + [Q_KEY_CODE_P] =3D 0x08, + [Q_KEY_CODE_RET] =3D 0x2a, + [Q_KEY_CODE_A] =3D 0x39, + [Q_KEY_CODE_S] =3D 0x3a, + + [Q_KEY_CODE_D] =3D 0x3b, + [Q_KEY_CODE_F] =3D 0x3c, + [Q_KEY_CODE_G] =3D 0x3d, + [Q_KEY_CODE_H] =3D 0x40, + [Q_KEY_CODE_J] =3D 0x3f, + [Q_KEY_CODE_K] =3D 0x3e, + [Q_KEY_CODE_L] =3D 0x2d, + [Q_KEY_CODE_SEMICOLON] =3D 0x2c, + [Q_KEY_CODE_APOSTROPHE] =3D 0x2b, + [Q_KEY_CODE_GRAVE_ACCENT] =3D 0x26, + [Q_KEY_CODE_SHIFT] =3D 0x00, + [Q_KEY_CODE_BACKSLASH] =3D 0x00, + [Q_KEY_CODE_Z] =3D 0x31, + [Q_KEY_CODE_X] =3D 0x32, + [Q_KEY_CODE_C] =3D 0x33, + [Q_KEY_CODE_V] =3D 0x34, + + [Q_KEY_CODE_B] =3D 0x35, + [Q_KEY_CODE_N] =3D 0x37, + [Q_KEY_CODE_M] =3D 0x36, + [Q_KEY_CODE_COMMA] =3D 0x2e, + [Q_KEY_CODE_DOT] =3D 0x2f, + [Q_KEY_CODE_SLASH] =3D 0x30, + [Q_KEY_CODE_SHIFT_R] =3D 0x00, + + [Q_KEY_CODE_SPC] =3D 0x38, }; =20 -static void queue_code(void *opaque, int code) +static void nextkbd_put_keycode(NextKBDState *s, int keycode) { - NextKBDState *s =3D NEXTKBD(opaque); KBDQueue *q =3D &s->queue; - int key =3D code & KD_KEYMASK; - int release =3D code & 0x80; - static int ext; - - if (code =3D=3D 0xE0) { - ext =3D 1; - } - - if (code =3D=3D 0x2A || code =3D=3D 0x1D || code =3D=3D 0x36) { - if (code =3D=3D 0x2A) { - s->shift =3D KD_LSHIFT; - } else if (code =3D=3D 0x36) { - s->shift =3D KD_RSHIFT; - ext =3D 0; - } else if (code =3D=3D 0x1D && !ext) { - s->shift =3D KD_LCOMM; - } else if (code =3D=3D 0x1D && ext) { - ext =3D 0; - s->shift =3D KD_RCOMM; - } - return; - } else if (code =3D=3D (0x2A | 0x80) || code =3D=3D (0x1D | 0x80) || - code =3D=3D (0x36 | 0x80)) { - s->shift =3D 0; - return; - } =20 if (q->count >=3D KBD_QUEUE_SIZE) { return; } =20 - q->data[q->wptr] =3D next_keycodes[key] | release; - + q->data[q->wptr] =3D keycode; if (++q->wptr =3D=3D KBD_QUEUE_SIZE) { q->wptr =3D 0; } @@ -241,6 +251,52 @@ static void queue_code(void *opaque, int code) /* s->update_irq(s->update_arg, 1); */ } =20 +static void nextkbd_event(DeviceState *dev, QemuConsole *src, InputEvent *= evt) +{ + NextKBDState *s =3D NEXTKBD(dev); + int qcode, keycode; + bool key_down =3D evt->u.key.data->down; + + qcode =3D qemu_input_key_value_to_qcode(evt->u.key.data->key); + if (qcode >=3D ARRAY_SIZE(qcode_to_nextkbd_keycode)) { + return; + } + + keycode =3D qcode_to_nextkbd_keycode[qcode]; + if (keycode =3D=3D NEXTKBD_NO_KEY) { + return; + } + + if (qcode =3D=3D Q_KEY_CODE_SHIFT) { + if (key_down) { + s->shift |=3D KD_LSHIFT; + } else { + s->shift &=3D ~KD_LSHIFT; + } + } + + if (qcode =3D=3D Q_KEY_CODE_SHIFT_R) { + if (key_down) { + s->shift |=3D KD_RSHIFT; + } else { + s->shift &=3D ~KD_RSHIFT; + } + } + + /* If key release event, create keyboard break code */ + if (!key_down) { + keycode |=3D 0x80; + } + + nextkbd_put_keycode(s, keycode); +} + +static const QemuInputHandler nextkbd_handler =3D { + .name =3D "QEMU NeXT Keyboard", + .mask =3D INPUT_EVENT_MASK_KEY, + .event =3D nextkbd_event, +}; + static void nextkbd_reset(DeviceState *dev) { NextKBDState *nks =3D NEXTKBD(dev); @@ -256,7 +312,7 @@ static void nextkbd_realize(DeviceState *dev, Error **e= rrp) memory_region_init_io(&s->mr, OBJECT(dev), &kbd_ops, s, "next.kbd", 0x= 1000); sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mr); =20 - qemu_add_kbd_event_handler(nextkbd_event, s); + qemu_input_handler_register(dev, &nextkbd_handler); } =20 static const VMStateDescription nextkbd_vmstate =3D { --=20 2.39.5 From nobody Sun Jan 5 02:56:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=ilande.co.uk Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1730491931460900.2662986398337; Fri, 1 Nov 2024 13:12:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6xzZ-0007vt-Dm; Fri, 01 Nov 2024 16:11:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6xzX-0007vT-Ip for qemu-devel@nongnu.org; Fri, 01 Nov 2024 16:11:31 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6xzW-0008Ey-1X for qemu-devel@nongnu.org; Fri, 01 Nov 2024 16:11:31 -0400 Received: from [2a00:23c4:8bb8:f600:91a1:336d:3931:745] (helo=localhost.localdomain) by mail.ilande.co.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t6xz8-0002Im-Ij; Fri, 01 Nov 2024 20:11:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ilande.co.uk; s=20220518; h=Subject:Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-Id:Date:To:From:Sender:Reply-To: Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=A1ft8g2YM2aWyxZ4YREHIJIsPwh8gyyf8Wh4XL5Qvsc=; b=QIKujqAINthm4c2gONSU87M+4X H4JxWOKVvdIBswAI7xylOtSJ1dujXaoqTzPWiXkn6WcgiRkq1aBLnsfRmB+3ns7toN2SZtgIYuNJl 3LO0Wrhe4A7QVmSf+gBNvNTmqa3THlbvkfPY5EtBKGuxuuM8U6tcWJ38qKxGUS/TcOVv5cXSns02l MCBAtsiqNrWholoLUptFVNCojSP0W4HHPO/+i9qVHHOeiWcjXO8hqBEQ0Aggb6sTfN5ugAsS+sUU5 uf3MD6T0bJvclrK39jeaEbPdPX2NiKY9gD39P/WtQF9S7f2aIUHeP0ku1FoMNCM4zgxz6Qn/heu2s Xyy8haqfPZQqrl+cMvtZzGPhiz7A36wLgNLel0nGAtaCVdrs1Qfu1rLp6Fw2dBoqN6UkCdUGJWIVc As0KhicfJkrV3caRmfFWZQejUv8DziJGcL5a3rbR/8bsqxGJYVM/ah1piO2o5ECohzEzsRzfoHyvr NZCKpow9ZRVGENi01GykYi4/6VlBdytV2CsjUSMHKrh1U35SeLCA0nt475tw9Ph8ft9WP+w4dr07R nO/KP5BUz5IxMjnbrp06/HSAd9m1IjmvW4eQ42lx2Xed5ObNidd+ABaXX3Tov1t/V1GpB+0ddHTrs vG0SLrnr94YwR/AX/iM9vJd0aBIYTHBT6VNIXBA2o=; From: Mark Cave-Ayland To: peter.maydell@linaro.org, huth@tuxfamily.org, qemu-devel@nongnu.org Date: Fri, 1 Nov 2024 20:11:06 +0000 Message-Id: <20241101201106.1432336-3-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241101201106.1432336-1-mark.cave-ayland@ilande.co.uk> References: <20241101201106.1432336-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2a00:23c4:8bb8:f600:91a1:336d:3931:745 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PATCH v3 2/2] ui/input-legacy.c: remove unused legacy qemu_add_kbd_event_handler() function X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.ilande.co.uk) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.ilande.co.uk X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1730491934040116600 Since the last keyboard device has now been converted over to use qemu_input_handler_register(), the legacy qemu_add_kbd_event_handler() func= tion is now unused and can be removed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/ui/console.h | 2 -- ui/input-legacy.c | 37 ------------------------------------- 2 files changed, 39 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index 5832d52a8a..46b3128185 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -70,8 +70,6 @@ typedef struct QEMUPutMouseEntry QEMUPutMouseEntry; typedef struct QEMUPutKbdEntry QEMUPutKbdEntry; typedef struct QEMUPutLEDEntry QEMUPutLEDEntry; =20 -QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, - void *opaque); QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func, void *opaque, int absolute, const char *name); diff --git a/ui/input-legacy.c b/ui/input-legacy.c index 210ae5eaca..ca4bccb411 100644 --- a/ui/input-legacy.c +++ b/ui/input-legacy.c @@ -109,43 +109,6 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_ti= me, int64_t hold_time, g_free(up); } =20 -static void legacy_kbd_event(DeviceState *dev, QemuConsole *src, - InputEvent *evt) -{ - QEMUPutKbdEntry *entry =3D (QEMUPutKbdEntry *)dev; - int scancodes[3], i, count; - InputKeyEvent *key =3D evt->u.key.data; - - if (!entry || !entry->put_kbd) { - return; - } - count =3D qemu_input_key_value_to_scancode(key->key, - key->down, - scancodes); - for (i =3D 0; i < count; i++) { - entry->put_kbd(entry->opaque, scancodes[i]); - } -} - -static const QemuInputHandler legacy_kbd_handler =3D { - .name =3D "legacy-kbd", - .mask =3D INPUT_EVENT_MASK_KEY, - .event =3D legacy_kbd_event, -}; - -QEMUPutKbdEntry *qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *o= paque) -{ - QEMUPutKbdEntry *entry; - - entry =3D g_new0(QEMUPutKbdEntry, 1); - entry->put_kbd =3D func; - entry->opaque =3D opaque; - entry->s =3D qemu_input_handler_register((DeviceState *)entry, - &legacy_kbd_handler); - qemu_input_handler_activate(entry->s); - return entry; -} - static void legacy_mouse_event(DeviceState *dev, QemuConsole *src, InputEvent *evt) { --=20 2.39.5