From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Regarding on-key-up event Date: Sat, 04 Feb 2023 09:09:15 +0200 Message-ID: <834js1vrdw.fsf@gnu.org> References: <83edr6vcia.fsf@gnu.org> <83cz6qv8qs.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21446"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ag Ibragimov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 04 08:09:30 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 1pOCfx-0005RD-Vv for ged-emacs-devel@m.gmane-mx.org; Sat, 04 Feb 2023 08:09:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOCff-00068b-6L; Sat, 04 Feb 2023 02:09:11 -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 1pOCfd-00068R-9z for emacs-devel@gnu.org; Sat, 04 Feb 2023 02:09:09 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOCfd-0006Tg-1h; Sat, 04 Feb 2023 02:09:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AIbiKvwWwEvzoXJ80h1L3pIKihgC9HD73ThxjJMnfzw=; b=RPiC5rg8qJiL p+2TMX22jAH3rb0EUNYbr1GrjULfCSpuLytPD1MkoxFFCx8GeqyNpTGmzbTPOCMhdQxAk2GME3qaC VqSAEnNhWOI8G5yLvQlviLBRrTJd5/FAY89gQ4aMaqzgEVwo5gDRDJ98cOcyg6TBHT6Z78NsWPk55 HSP4yhoF5MQBhom2l892P0HMgPwKi7V1ZoDOMOlRZbyXSw7huLnMEdCoLxX8SDnFNCjkMBc3J7AvA VSTa0geYxm3E5+1Z03FcAKp+msTSitmnhYucEbQ3n3OfteNRb8N3JkZ7EaPjd2SbaxaWJCzoRSx6x G6XxsIyT7vEEQ/QsTcuH+Q==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOCfc-0001NV-Gw; Sat, 04 Feb 2023 02:09:08 -0500 In-Reply-To: (message from Ag Ibragimov on Fri, 03 Feb 2023 17:45:20 -0600) 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:302952 Archived-At: > From: Ag Ibragimov > 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.