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: Ag Ibragimov
Subject: Re: Regarding on-key-up event
Date: Fri, 03 Feb 2023 17:45:20 -0600

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 via email to

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