emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regarding on-key-up event


From: Eli Zaretskii
Subject: Re: Regarding on-key-up event
Date: Sat, 04 Feb 2023 09:09:15 +0200

> From: Ag Ibragimov <agzam.ibragimov@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 03 Feb 2023 17:45:20 -0600
> 
> > 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?

No.  I already said that Emacs only receives a key when it is
released.  So we can have on-key-release events, but not on-key-press
events.  And pressing and release only a modifier key, such as Alt,
doesn't normally deliver any key event to Emacs.

> > 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?

The key-pressed events are actually key-release events, see above.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]