From: Eli Zaretskii <eliz@gnu.org>
To: Cecilio Pardo <cpardo@imayhem.com>,
Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 74423@debbugs.gnu.org
Subject: bug#74423: Low level key events
Date: Tue, 19 Nov 2024 17:29:00 +0200 [thread overview]
Message-ID: <86ttc3tf7n.fsf@gnu.org> (raw)
In-Reply-To: <d5c72818-e907-43f5-853a-89ec01264157@imayhem.com> (message from Cecilio Pardo on Mon, 18 Nov 2024 21:35:40 +0100)
> Date: Mon, 18 Nov 2024 21:35:40 +0100
> From: Cecilio Pardo <cpardo@imayhem.com>
>
> 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).
next prev parent reply other threads:[~2024-11-19 15:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fb50ec11-7aec-481e-8a3a-ecdcf22eb7c0@imayhem.com>
[not found] ` <31bdc55d-8c13-4de0-9cef-bd6cc4fb033f@imayhem.com>
[not found] ` <s1r8qtzsvbe.fsf@yahoo.com>
2024-11-18 20:35 ` bug#74423: Low level key events Cecilio Pardo
2024-11-18 23:49 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-19 15:29 ` Eli Zaretskii [this message]
2024-11-19 16:43 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-11-19 20:05 ` Cecilio Pardo
2024-11-20 4:21 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86ttc3tf7n.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=74423@debbugs.gnu.org \
--cc=cpardo@imayhem.com \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).