[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regarding on-key-up event
From: |
Po Lu |
Subject: |
Re: Regarding on-key-up event |
Date: |
Sat, 04 Feb 2023 08:34:25 +0800 |
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?
>
- Re: Regarding on-key-up event, (continued)
- Re: Regarding on-key-up event, Eli Zaretskii, 2023/02/03
- Re: Regarding on-key-up event, Ag Ibragimov, 2023/02/03
- Re: Regarding on-key-up event, Eli Zaretskii, 2023/02/03
- Re: Regarding on-key-up event, Konstantin Kharlamov, 2023/02/03
- Re: Regarding on-key-up event, Konstantin Kharlamov, 2023/02/03
- Re: Regarding on-key-up event, Po Lu, 2023/02/03
- Re: Regarding on-key-up event, Ag Ibragimov, 2023/02/03
- Re: Regarding on-key-up event, Po Lu, 2023/02/03
- Re: Regarding on-key-up event, Eli Zaretskii, 2023/02/04
- Re: Regarding on-key-up event, Ag Ibragimov, 2023/02/03
- Re: Regarding on-key-up event,
Po Lu <=
- Re: Regarding on-key-up event, Eli Zaretskii, 2023/02/04
- Re: Regarding on-key-up event, chad, 2023/02/04