unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu <Luangruo@yahoo.com>
To: emacs-devel@gnu.org, Ag Ibragimov <agzam.ibragimov@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>
Subject: Re: Regarding on-key-up event
Date: Sat, 04 Feb 2023 08:34:25 +0800	[thread overview]
Message-ID: <3A119100-DA67-480B-A38D-A686A399C960@yahoo.com> (raw)
In-Reply-To: <m2y1pefh4f.fsf@gmail.com>

Also, I forgot to say that key press repetition is implemented in the X server, not a toolkit.

On February 4, 2023 7:45:20 AM GMT+08:00, Ag Ibragimov <agzam.ibragimov@gmail.com> wrote:
>Eli Zaretskii <eliz@gnu.org> writes:
>
>Sorry Eli, I accidentally replied without CC, so this one would show up
>for you twice. My apologies.
>
>>> From: Ag Ibragimov <agzam.ibragimov@gmail.com>
>>> Cc: emacs-devel@gnu.org
>>> Date: Fri, 03 Feb 2023 13:25:53 -0600
>>> 
>>> > I don't think I understand the question.  Emacs produces a key event
>>> > when a key was pressed and then released.  So technically, we already
>>> > have an "on-key-up" event.
>>> 
>>> But you can't register "on-release" event, right? That makes for example
>>> difficult to implement UX similar to an app switcher in a desktop
>>> manager - Alt+Tab. Where as long you keep holding Alt, pressing Tab
>>> performs an action, but releasing Alt-key gets you out.
>>
>> Yes, you can "register" an on-release event, just not for modifier
>> keys like Shift or Alt.
>>
>
>Wait, really? Are you saying that aside the modifier keys, it's possible to let's say
>bind a command to a key e.g., (kbd "a"), so when a user presses the key,
>it would to run one command, but when the key is released to run a
>different command?
>
>>> Or even something much simpler, like temporarily increasing the
>>> font-size while you hold the key.
>>
>> While you hold a key, a typical keyboard auto-repeats, so I see no
>> problem here.
>
>Right, it would auto-repeat, registering a sequence of "key-pressed"
>events, but can we detect when the key gets released?
>



  reply	other threads:[~2023-02-04  0:34 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
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 [this message]
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

  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=3A119100-DA67-480B-A38D-A686A399C960@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=agzam.ibragimov@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).