From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74423: Low level key events Date: Tue, 19 Nov 2024 17:29:00 +0200 Message-ID: <86ttc3tf7n.fsf@gnu.org> References: <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33246"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74423@debbugs.gnu.org To: Cecilio Pardo , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 19 16:30:37 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 1tDQBZ-0008TI-2j for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Nov 2024 16:30:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tDQBB-00042q-Ed; Tue, 19 Nov 2024 10:30:14 -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 1tDQB2-00042P-EM for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 10:30:07 -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 1tDQB0-0007mZ-EQ for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 10:30:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=00rfOvUGulpPowx1DN4JifuMT1rz9RLWJYkR48FS9D4=; b=j8niRMuZcHAXstxMzTt7jsduPqieSkH/NLtDxpbfz13ckLntLb3fK8+H0xrFNmmKgRWc45jB771ejy471KTVkHCqp9nzNmLKfv2WjSGokS2eHsOftvnB44cDwrVMqpznU0I6nB6IZOtorLXWAbXglOIdGZqJf/Ikab/3GN08AClP2u4TlKCtdRe/m4T23ZC9e0KLAG4xoNglfjDyaDXgAQ2gtlzf3v7NlcZ4KY3rOuEqcCUiun7iL9NVNNvX4R91Yk5ECDBptOZ675uC11SnZYYUMQL4ozzNV2lq2LZCSU/aOPkLsnT0F+Mu8Yn/KpKQGNLPZ4wFl7eFtUWV8szxxg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tDQB0-0003ay-6B for bug-gnu-emacs@gnu.org; Tue, 19 Nov 2024 10:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Nov 2024 15:30: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.173203015313727 (code B ref 74423); Tue, 19 Nov 2024 15:30:02 +0000 Original-Received: (at 74423) by debbugs.gnu.org; 19 Nov 2024 15:29:13 +0000 Original-Received: from localhost ([127.0.0.1]:43672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDQAC-0003ZL-KG for submit@debbugs.gnu.org; Tue, 19 Nov 2024 10:29:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:32918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDQA9-0003Z5-QN for 74423@debbugs.gnu.org; Tue, 19 Nov 2024 10:29:10 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tDQA2-0007ci-Gf; Tue, 19 Nov 2024 10:29:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=00rfOvUGulpPowx1DN4JifuMT1rz9RLWJYkR48FS9D4=; b=gtX3lteCA7Nh Gd0S1o0nRaR4zx3+u+Pslj7gSqlUARZzoz0465PZIhRYulfhIvh8LfctbnPcdLh1g3wwCBmnkO4Ek lA6zC+LiftRpq0MxCHXxXZmK8PD8IJHJhLPAWf4E8YJd5r4K5uu2O2aSEMJGrPVUPDdD0p3hdRUE7 eiJh7GQn6v3zIgge/VaORijGuMu01bvX+528Cp5SMF7SQKv61NVXGbJuv4jNLbLzDwFKwwhTrFQKI GJqUpSGnWPz3qgt/HNjc79A/2aXiQsGbJfoo3UoZlROfOKiqlr0IDuGd6VVcVPWjxBzCnTsX1XZma 6yilzsBboaRxnJa5kZiGIA==; In-Reply-To: (message from Cecilio Pardo on Mon, 18 Nov 2024 21:35:40 +0100) 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:295638 Archived-At: > Date: Mon, 18 Nov 2024 21:35:40 +0100 > From: Cecilio Pardo > > Here is a still incomplete patch for this, renamed from "physical > keyboard events", following up to > https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00085.html > > It provides events for press/release of keys, independently of the > normal keyboard events. These events are bound int the > special-event-map. Some lisp is included to implement detection of > multiple tapping on keys, and running commands or simulating modifiers. Thanks, I have some minor comments, and also added Stefan to the discussion, in case he will also have comments. > + if (!Venable_low_level_key_events) You treat this variable as a C boolean, i.e. assume it was defined with DEFVAR_BOOL, but in that case our convention is to call the C variables without the leading 'V'. OTOH, if you envision that this variable could be something other than nil or t in Lisp, then you need to use NILP here. > + DEFVAR_LISP ("enable-low-level-key-events", Venable_low_level_key_events, > + doc: /* Enabled the recepcion of low level key events. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "If non-nil, reception of low-level key events is enabled." > +static void > +pgtk_maybe_send_low_level_key_event (GdkEvent *event) > +{ > + if (!Venable_low_level_key_events) > + return; Same problem with the test here. > --- a/src/w32fns.c > +++ b/src/w32fns.c > @@ -4669,6 +4669,11 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) > case WM_KEYUP: > case WM_SYSKEYUP: > record_keyup (wParam, lParam); > + if (Venable_low_level_key_events) > + { > + signal_user_input (); > + my_post_msg( &wmsg, hwnd, WM_EMACS_LOW_LEVEL_KEY, wParam, lParam ); > + } And here (and in several other places in the patch).