all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu <Luangruo@yahoo.com>
To: emacs-devel@gnu.org, Konstantin Kharlamov <hi-angel@yandex.ru>,
	Eli Zaretskii <eliz@gnu.org>,
	Ag Ibragimov <agzam.ibragimov@gmail.com>
Subject: Re: Regarding on-key-up event
Date: Sat, 04 Feb 2023 08:18:54 +0800	[thread overview]
Message-ID: <C46E309C-6738-4A06-B531-28D19380760B@yahoo.com> (raw)
In-Reply-To: <f6e921cc0bfd9a22fb084bfe9c28e647db09dc0f.camel@yandex.ru>

This nice behavior may be guaranteed by a keyboard itself, but not by input methods, where it is actually impossible to match up an input method's committed key events with a corresponding key release event.

Of course, since the input method is not operating synchronously wrt the X connection, there is not even the guarantee that the key release arrives after the key press, since the latter are not filtered through it.  And for good reason; imagine that the input method commits a string, abcdef, and Emacs generates one key event for each character.

Which key release events should Emacs then deliver?

On February 4, 2023 5:47:14 AM GMT+08:00, Konstantin Kharlamov <hi-angel@yandex.ru> wrote:
>On Fri, 2023-02-03 at 21:39 +0200, Eli Zaretskii wrote:
>> 
>> While you hold a key, a typical keyboard auto-repeats, so I see no
>> problem here.
>
>I am not aware of any keyboard that repeats its events upon holding a key.
>Repetition is usually implemented in a toolkit handling key events. A keyboard
>typically sends a single "pressed" event, and then after you done holding a key
>it sends a "released" event.
>
>Here's a proof: I run `libinput debug-events --verbose`, then hold `j`:
>
>    $ libinput debug-events --verbose
>    […]
>    -event6   KEYBOARD_KEY            +0.000s       *** (-1) pressed
>    jjjjjjjjjjjjjjjjjj event6   KEYBOARD_KEY            +1.280s     *** (-1)
>released
>    […]
>
>See, there are repeating `j` on the screen, but it's created by the Qt toolkit
>of my Konsole terminal. Keyboard sent only 2 events: `pressed` and `released`.
>



  parent reply	other threads:[~2023-02-04  0:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 17:31 Regarding on-key-up event Ag Ibragimov
2023-02-03 18:18 ` Eli Zaretskii
2023-02-03 19:25   ` Ag Ibragimov
2023-02-03 19:39     ` Eli Zaretskii
2023-02-03 21:47       ` Konstantin Kharlamov
2023-02-03 22:05         ` Konstantin Kharlamov
2023-02-04  0:18         ` Po Lu [this message]
2023-02-04  0:48           ` Ag Ibragimov
2023-02-04  1:26             ` Po Lu
2023-02-04  7:07         ` Eli Zaretskii
2023-02-03 23:45       ` Ag Ibragimov
2023-02-04  0:34         ` Po Lu
2023-02-04  7:09         ` Eli Zaretskii
2023-02-04 15:47           ` chad

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C46E309C-6738-4A06-B531-28D19380760B@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=agzam.ibragimov@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=hi-angel@yandex.ru \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.