From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ag Ibragimov Newsgroups: gmane.emacs.devel Subject: Re: Regarding on-key-up event Date: Fri, 03 Feb 2023 17:45:20 -0600 Message-ID: References: <83edr6vcia.fsf@gnu.org> <83cz6qv8qs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9069"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 04 00:46:11 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pO5kx-0002AC-1y for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Feb 2023 00:46:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pO5kE-00043V-Ds; Fri, 03 Feb 2023 18:45:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pO5kC-00041r-Gs for emacs-devel@gnu.org; Fri, 03 Feb 2023 18:45:24 -0500 Original-Received: from mail-oa1-x2b.google.com ([2001:4860:4864:20::2b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO5kA-0000V1-N6; Fri, 03 Feb 2023 18:45:24 -0500 Original-Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1636eae256cso8630345fac.0; Fri, 03 Feb 2023 15:45:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=DYK7jGQhiIrZMS5K/7g32QdvxlxyhB3muGR2VqF27ZI=; b=YfWsUvq4Xqajg2K1WFFyxjzDooTlnk4yExAsEky9eD9LhfmQEC/NWBb2b8IG2KBBt3 2yKohkzgIE1LqUQEdlgo2APedQVj7fxalF6I9d/21RpG5kfos74q7efgYm8YqkI5OhGB oRur9+2tM8zlKXEwuRah4CLDaRuQBIhnq6xpD7cAusK/eVAkM+ZbQ4UVf8LFtt/0h3Ap 5oyKieyNRCvx7RKBBKc0I017BTMC7yG7A0Od54FGNk/QoZ3Exq8ztB2onMhmdgdOjjqm kjsB5A7BredubNH1CuuduJ9f+x6XMJAXwzhPJWz/RbOSs2XcQyoQMH3z2WnqsHUJagy6 KsqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DYK7jGQhiIrZMS5K/7g32QdvxlxyhB3muGR2VqF27ZI=; b=oEW2zQTqK2IQPff5f3ZMmRCXk7vmxf2XOqZ+DRBdn80HAOMLop2M8vgizyvqdsJy00 QanL/9zCMV4bc7gfDkbCUagxmuALiQc81Irn1LKdykpwokcESuiK3/ymyRiOlzbCNLPp khDLbCQEFy04MMd09EdfC+qn4+GaIbmkTmrrbPl9bKkiz1b428/0JLGC/lpTwpfY9GAD qo2tlHclmzszz0cjev5HUs/mLLCN812xlUb0T8VQ7KEEKXgmkacuiU6nhpQiRcPXByNa p1bYGxFKo6Nh4DMOeK4OBakK6S5CfUS1vkFlQjJyFjkMs2hYILn4O0ZAogJoP+IAFulI GnCw== X-Gm-Message-State: AO0yUKXloVygi062UXNXCBfRuywvleoeSOsPLCFeWkGCYrS5b56gtJl7 VdD3CydJGq5JlKTQfxXf10FVoM7CtsM= X-Google-Smtp-Source: AK7set/VpgEalA2nzBsZnr9hOj6MzUYUhywZDgYVWaJDA0Ydt+0EUV82qdL/cZ5hgkh3MguUzabsIg== X-Received: by 2002:a05:6870:4255:b0:15b:9ab9:75ee with SMTP id v21-20020a056870425500b0015b9ab975eemr7213911oac.48.1675467920896; Fri, 03 Feb 2023 15:45:20 -0800 (PST) Original-Received: from AIBRAGIM-M-J8Z8 ([2001:420:c0cc:1004::f1]) by smtp.gmail.com with ESMTPSA id d40-20020a056870d2a800b00130d060ce80sm1338794oae.31.2023.02.03.15.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 15:45:20 -0800 (PST) In-Reply-To: <83cz6qv8qs.fsf@gnu.org> Received-SPF: pass client-ip=2001:4860:4864:20::2b; envelope-from=agzam.ibragimov@gmail.com; helo=mail-oa1-x2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302941 Archived-At: Eli Zaretskii writes: Sorry Eli, I accidentally replied without CC, so this one would show up for you twice. My apologies. >> From: Ag Ibragimov >> 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?