From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74423: Low level key events Date: Sat, 14 Dec 2024 09:16:45 +0800 Message-ID: <87ldwjqd1e.fsf@yahoo.com> References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> <705fabb8-1ea0-4894-8c32-05097ab822c9@imayhem.com> <868qsvz07i.fsf@gnu.org> <162dada7-ad54-4ca5-8f11-d55dd6dccb3c@imayhem.com> <867c8ezny3.fsf@gnu.org> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21418"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74423@debbugs.gnu.org, Eli Zaretskii , monnier@iro.umontreal.ca To: Cecilio Pardo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 14 02:18:30 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tMGnd-0005OI-6L for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Dec 2024 02:18:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMGnG-0007In-0X; Fri, 13 Dec 2024 20:18:07 -0500 Original-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 1tMGnD-0007IP-3S for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 20:18:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMGnC-0000Z3-Py for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 20:18:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=uo9I+srJwYo1FwkONd0I20DXr/OyjzvPTAgbLbgFIRI=; b=aMIqycBVEW2kQiKva++HfQNNM3prU1BMKCDw/XUDIkdk+uOfqFfN+M7wWhNYYODE3K1k+9p5rKGGuFANMNRb4mmgRqklhiRN+xfrH3HDf7bH9V0aASqwoo8SdlOzeXQ+DRQxaCsZ78W53EOlHGgSdSBN00TNyiM9q0BDWOX8f8qmyZnIFnbG0Z9fJEuDP/mLC/uBsoFtVAOrip5HQRZs9usJwWdNCfSg263dWf1s+X0qWK1NcQADZsc12/wV601VriIBO+Noui7QD0eHPs1t4NlLF81L45+v4qnOrEhhDrusKmZrXB+IgDGdTXXyA8L8sTXN0O0WeAE0m6aX96Ifpw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tMGnC-0008Qe-2b for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2024 20:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Dec 2024 01:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74423 X-GNU-PR-Package: emacs Original-Received: via spool by 74423-submit@debbugs.gnu.org id=B74423.173413903132309 (code B ref 74423); Sat, 14 Dec 2024 01:18:02 +0000 Original-Received: (at 74423) by debbugs.gnu.org; 14 Dec 2024 01:17:11 +0000 Original-Received: from localhost ([127.0.0.1]:44857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMGmN-0008P2-0B for submit@debbugs.gnu.org; Fri, 13 Dec 2024 20:17:11 -0500 Original-Received: from [66.163.191.206] (port=43194 helo=sonic312-25.consmr.mail.ne1.yahoo.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tMGmJ-0008OI-GV for 74423@debbugs.gnu.org; Fri, 13 Dec 2024 20:17:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1734139015; bh=uo9I+srJwYo1FwkONd0I20DXr/OyjzvPTAgbLbgFIRI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=n14dAkHTPoihZovsBmyWdP6uCpmxcgIE4+k+ToEidT5PvzxTX9S8S+IwJSQPfsewswndKf6H3atQJENRpgS7CMqJJrx4jErbaL9zZndTseK2NWhEYcGyJh6uukkurH0Fya4lLr5rvfCcRi90H/IABmED7S/F7XxlgkCBKYnB4t732EV+3/aBKbk5KA0/7khABI34JD3a5IJOYKq54tCN002u8Rgnvp/PTg/F1k/K2FL0ij9htroCQrZF5jysqAySEifXVR18ZxkxoROpe//CSJHbKQTIxmoV6HLEm2ktfQRBYFT0VjfyI6/DT5X7kZw1Mi1GxoqN/EaUJGmX2ELiRA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1734139015; bh=RE3qA52TYjIjfdFVeaTtPaZpEzhKt0c2ng8ze/F3Q0a=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=gh1HYbXm2CjRD5ACcPSww77zoYbep+zXq7qgrut8HDFDv6ADxjVSI3vnFyCVwEFLjb0UnWaWjUKflidgIJe7/BKGk8tm0PyQZoUHEDkgoqzGPXXDS4UKwQfwWvUcXmDAcfzygEyGR0Z89FGOCAjOeqGkMZAEI2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UX X-Sonic-MF: X-Sonic-ID: 22b03926-2eab-4c0a-8ded-915aef95437a Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Sat, 14 Dec 2024 01:16:55 +0000 Original-Received: by hermes--production-sg3-5b7954b588-wvg78 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 33346bddb3cfa286c1b5c31d84f311fe; Sat, 14 Dec 2024 01:16:50 +0000 (UTC) In-Reply-To: (Cecilio Pardo's message of "Fri, 13 Dec 2024 23:55:18 +0100") X-Mailer: WebService/1.1.23040 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297002 Archived-At: Cecilio Pardo writes: > +#ifndef HAVE_XINPUT2 > +static void > +xg_maybe_send_low_level_key_event (struct frame *f, > + GdkEvent *xev) > +{ > + GdkEventKey xkey = xev->key; > + bool is_press; > + Lisp_Object key, modifier; > + union buffered_input_event inev; > + > + if (NILP (Venable_low_level_key_events)) > + return; > + > + switch (xev->type) > + { > + case GDK_KEY_PRESS: > + is_press = true; > + break; > + case GDK_KEY_RELEASE: > + is_press = false; > + break; > + default: > + return; > + } > + > + modifier = x_get_modifier_for_keycode (FRAME_OUTPUT_DATA (f)->display_info, > + xev->key.hardware_keycode); > + > + int keysym = xkey.keyval; > + > + if (keysym >= GDK_KEY_a && keysym <= GDK_KEY_z) > + keysym -= GDK_KEY_a - GDK_KEY_A; > + > + if (!kbd_low_level_key_is_enabled (keysym, modifier)) > + return; > + > + key = make_fixnum (keysym); > + > + EVENT_INIT (inev.ie); > + XSETFRAME (inev.ie.frame_or_window, f); > + inev.ie.kind = LOW_LEVEL_KEY_EVENT; > + inev.ie.timestamp = xkey.time; > + inev.ie.arg = list3 (is_press ? Qt : Qnil, key, modifier); > + kbd_buffer_store_buffered_event (&inev, &xg_pending_quit_event); > +} > +#endif Why is this !HAVE_XINPUT2? GTK input method support exists independently of XInput 2.