unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Cecilio Pardo <cpardo@imayhem.com>
Cc: 74423@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	monnier@iro.umontreal.ca
Subject: bug#74423: Low level key events
Date: Sat, 14 Dec 2024 09:16:45 +0800	[thread overview]
Message-ID: <87ldwjqd1e.fsf@yahoo.com> (raw)
In-Reply-To: <c0bd3bff-4546-4169-9e5d-ba60ef059b6c@imayhem.com> (Cecilio Pardo's message of "Fri, 13 Dec 2024 23:55:18 +0100")

Cecilio Pardo <cpardo@imayhem.com> 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.





      reply	other threads:[~2024-12-14  1:16 UTC|newest]

Thread overview: 15+ 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-23 12:08         ` Cecilio Pardo
2024-11-19 15:29       ` Eli Zaretskii
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
2024-12-02 16:54             ` Cecilio Pardo
2024-12-04 20:01               ` Eli Zaretskii
2024-12-04 21:25                 ` Cecilio Pardo
2024-12-05  5:41                   ` Eli Zaretskii
2024-12-06  1:01                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-12-07 21:52                       ` Cecilio Pardo
2024-12-13 22:55                     ` Cecilio Pardo
2024-12-14  1:16                       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=87ldwjqd1e.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=74423@debbugs.gnu.org \
    --cc=cpardo@imayhem.com \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.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).