GNU bug report logs - #22163
Feature request: Add support for key release event

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Simon Friis Vindum <simonfv@HIDDEN>; dated Sun, 13 Dec 2015 17:51:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 22163 <at> debbugs.gnu.org:


Received: (at 22163) by debbugs.gnu.org; 15 Dec 2015 20:27:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 15 15:27:20 2015
Received: from localhost ([127.0.0.1]:52956 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8wBs-0003yF-Lm
	for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 15:27:20 -0500
Received: from mail-pa0-f48.google.com ([209.85.220.48]:36846)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <jwiegley@HIDDEN>) id 1a8wBq-0003y2-8D
 for 22163 <at> debbugs.gnu.org; Tue, 15 Dec 2015 15:27:18 -0500
Received: by mail-pa0-f48.google.com with SMTP id nt2so546545pab.3
 for <22163 <at> debbugs.gnu.org>; Tue, 15 Dec 2015 12:27:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:in-reply-to:date:message-id:references
 :user-agent:mime-version:content-type;
 bh=KsxWQYXrfrYCHk8KcCkXFdHuNfcROOa7ZOPA2tzwsn0=;
 b=qHS8zIDoDBTHgJaZ222c3+uUgdsgnbMUghf7p4g9lUXNuzZx9XWXFV1q54gmcBLJrk
 5ATgFGAoDD3krD6i0QzxRBTyRVI4zs6hwvBSfn9sZisE8dkJwwUO0TiN+XFRrGaKoutS
 F2YMSts/3Eh8V/l0J6N0RkRtkTAJCZ4TWIvqwfIAh7igdhM8CPR+fNcClP1miaz9GtaF
 Zym63HYoFv8i5GyI+cquhfngkBX+vmi8y/wBC64pdHU4CsxWoYJEbZUOvmiQvTvqrvxC
 66Amb2+D8ipWJZudNfD/kuTl4z9N5MPJ1FbNjlWZWBeVGzXx/nKSIs8VtllKO3wLKRTA
 ZnlQ==
X-Received: by 10.66.150.37 with SMTP id uf5mr58311977pab.30.1450211232537;
 Tue, 15 Dec 2015 12:27:12 -0800 (PST)
Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net.
 [76.234.68.79])
 by smtp.gmail.com with ESMTPSA id yl1sm4044530pac.35.2015.12.15.12.27.10
 (version=TLS1 cipher=AES128-SHA bits=128/128);
 Tue, 15 Dec 2015 12:27:10 -0800 (PST)
From: John Wiegley <jwiegley@HIDDEN>
X-Google-Original-From: "John Wiegley" <johnw@HIDDEN>
Received: by Vulcan.local (Postfix, from userid 501)
 id E54811174D393; Tue, 15 Dec 2015 12:27:09 -0800 (PST)
To: Simon Friis Vindum <simonfv@HIDDEN>
Subject: Re: bug#22163: Feature request: Add support for key release event
In-Reply-To: <CAGqLG_ucFQC=u6xAh0KHD8qiOf2S2g7wLFDO_0YBQGVsWfQWLg@HIDDEN>
 (Simon Friis Vindum's message of "Tue, 15 Dec 2015 21:15:29 +0100")
Date: Tue, 15 Dec 2015 12:27:08 -0800
Message-ID: <m2si334fvn.fsf@HIDDEN>
References: <CAGqLG_vE72KiBeUMbN8LMsokx9az1i4krzG=YyAQ0VozEyz6dg@HIDDEN>
 <CAGqLG_ucFQC=u6xAh0KHD8qiOf2S2g7wLFDO_0YBQGVsWfQWLg@HIDDEN>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 22163
Cc: 22163 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

>>>>> Simon Friis Vindum <simonfv@HIDDEN> writes:

> I was thinking that one might define a new built-in function. It could for
> instance be called `define-key-release` and behave exactly like `define-key`
> except that the passed command would be triggered on key release instead of
> key press.
> 
> It seems to me like that would be backwards compatible and non-invasive.

Sure, from the point of view of `define-key', it would be. What I meant is
that key-handling right now is done on the basis of received events, and that
"key pressed down" is not an event. We only have "key pressed".

I don't know how hard it would be to break up key events into multiple phases,
or how backwards compatible it would be to see a union of up/down phases as
equivalent to what we know now as a "key press" event.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#22163; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Dec 2015 20:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 15 15:15:40 2015
Received: from localhost ([127.0.0.1]:52952 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8w0a-0003i0-JU
	for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 15:15:40 -0500
Received: from eggs.gnu.org ([208.118.235.92]:47339)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <simonfv@HIDDEN>) id 1a8w0Y-0003hl-Gq
 for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 15:15:38 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a8w0S-0000fb-8G
 for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 15:15:33 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:35377)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a8w0S-0000fP-0X
 for submit <at> debbugs.gnu.org; Tue, 15 Dec 2015 15:15:32 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57319)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a8w0Q-000288-N4
 for bug-gnu-emacs@HIDDEN; Tue, 15 Dec 2015 15:15:31 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a8w0P-0000em-Vz
 for bug-gnu-emacs@HIDDEN; Tue, 15 Dec 2015 15:15:30 -0500
Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:34660)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a8w0P-0000eg-QP
 for bug-gnu-emacs@HIDDEN; Tue, 15 Dec 2015 15:15:29 -0500
Received: by mail-qk0-x22b.google.com with SMTP id p187so31779428qkd.1
 for <bug-gnu-emacs@HIDDEN>; Tue, 15 Dec 2015 12:15:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=TOrCB7BF/vhzbhc537poZ3nrr25sJYmK3+hWP7Bm6yo=;
 b=J59OcUkw5j9SiFtsX+/5M0S2TYjjgGkdAw2oNNEphLJmeBtFCEt6/WBh0gbdH7xbEw
 8ftupKmrWadoeAgWvvM5c7UsP0zvQwwx9wFdNHAmolJOO7ha6K6QdyFWeBidrDDL9aW1
 0QswI5H2Yp9lp+7vDf1xUzQLvgEXBBxcNYtYoOucgc9V3H8bYTSxh2OhileLBEiGrxdE
 U39kAVVNyNi+yJRNv4t3fgG10ztSktngdlpTnBIKHxFhIgHJSffZqggMgiGNhfZ4VeOL
 Jz7keC3cVrAyOstosmf0W77vJGGIxoSHU1Ok0lD08WSBDG8Y/ptBs6Dl0CaVdrRc8krt
 Rwvg==
MIME-Version: 1.0
X-Received: by 10.129.101.5 with SMTP id z5mr24250421ywb.184.1450210529277;
 Tue, 15 Dec 2015 12:15:29 -0800 (PST)
Received: by 10.37.215.8 with HTTP; Tue, 15 Dec 2015 12:15:29 -0800 (PST)
Date: Tue, 15 Dec 2015 21:15:29 +0100
Message-ID: <CAGqLG_ucFQC=u6xAh0KHD8qiOf2S2g7wLFDO_0YBQGVsWfQWLg@HIDDEN>
Subject: bug#22163: Feature request: Add support for key release event
From: Simon Friis Vindum <simonfv@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

>>>>> John Wiegley <address@hidden> writes:

> Those who understand the fundamentals of event handling would know better, but
> doing this right could be a rather invasive change. For example: Should
> `read-event' return once a key is pressed down; or should it wait until the
> key has been released, and then also give both the press-down and release
> times? At the moment, it just notifies the user of the key?

I was thinking that one might define a new built-in function. It could
for instance
be called `define-key-release` and behave exactly like `define-key`
except that the
passed command would be triggered on key release instead of key press.

It seems to me like that would be backwards compatible and non-invasive.

> Because once you have sensitive to "length of press", I imagine that's just
> the start of additional information you'd want about events and how they
> relate in time to each other...

I think that if you can get the press and release of a key then you have access
to all information from the hardware. Everything else can be derived from that.

Kind regards
Simon Friis Vindum




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#22163; Package emacs. Full text available.

Message received at 22163 <at> debbugs.gnu.org:


Received: (at 22163) by debbugs.gnu.org; 14 Dec 2015 22:17:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 14 17:17:19 2015
Received: from localhost ([127.0.0.1]:51969 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8bQl-0005bk-1I
	for submit <at> debbugs.gnu.org; Mon, 14 Dec 2015 17:17:19 -0500
Received: from mail-pf0-f177.google.com ([209.85.192.177]:35681)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <jwiegley@HIDDEN>) id 1a8bQj-0005bN-6D
 for 22163 <at> debbugs.gnu.org; Mon, 14 Dec 2015 17:17:17 -0500
Received: by pff63 with SMTP id 63so18358931pff.2
 for <22163 <at> debbugs.gnu.org>; Mon, 14 Dec 2015 14:17:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:in-reply-to:date:message-id:references
 :user-agent:mime-version:content-type;
 bh=v/9VEX6u+B02pNy3Vg0XTxyKyLPv0EHfrx3ISIRxOrs=;
 b=ZaLOh6LbMeTYRTW4uhv8h0BZ6grLTzsZBjXXPCx0mQhCVc3OuCs9k/o89+Kb6/mhDA
 jBWoCHK4hbKC0RwaFDyllDs4n296nLw3pnUMB8KeRsT8pvLUl0l5MrPzFM15g4vadu+n
 /jp9f0Z82LS3n5xbKqHJJEbIXKIbSUEdkFerJs4VsFuwZjPQWCfNnNYptlkZyusSzqBI
 oi3fxF4tmwtUE2IckH0nRuElBW2lERowI06I89/9l0TXLAT8ThZPYTQDJxIu9FiT6Zpm
 aqDhQMK26EZ/OYvuGjQALcS9o3xN+Pfz9xBoUUldnhqgXTCFv5PazJw99t4lo8QexF0V
 r71A==
X-Received: by 10.98.86.221 with SMTP id h90mr10691962pfj.121.1450131431504;
 Mon, 14 Dec 2015 14:17:11 -0800 (PST)
Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net.
 [76.234.68.79])
 by smtp.gmail.com with ESMTPSA id 78sm24044544pfr.2.2015.12.14.14.17.09
 (version=TLS1 cipher=AES128-SHA bits=128/128);
 Mon, 14 Dec 2015 14:17:09 -0800 (PST)
From: John Wiegley <jwiegley@HIDDEN>
X-Google-Original-From: "John Wiegley" <johnw@HIDDEN>
Received: by Vulcan.local (Postfix, from userid 501)
 id B1419115DAAEF; Mon, 14 Dec 2015 14:17:08 -0800 (PST)
To: Simon Friis Vindum <simonfv@HIDDEN>
Subject: Re: bug#22163: Feature request: Add support for key release event
In-Reply-To: <CAGqLG_vE72KiBeUMbN8LMsokx9az1i4krzG=YyAQ0VozEyz6dg@HIDDEN>
 (Simon Friis Vindum's message of "Sun, 13 Dec 2015 09:58:07 +0100")
Date: Mon, 14 Dec 2015 14:17:06 -0800
Message-ID: <m2io40ekv1.fsf@HIDDEN>
References: <CAGqLG_vE72KiBeUMbN8LMsokx9az1i4krzG=YyAQ0VozEyz6dg@HIDDEN>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 22163
Cc: 22163 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

>>>>> Simon Friis Vindum <simonfv@HIDDEN> writes:

> It should be possible to bind functions to the _release_ of a key.

Those who understand the fundamentals of event handling would know better, but
doing this right could be a rather invasive change. For example: Should
`read-event' return once a key is pressed down; or should it wait until the
key has been released, and then also give both the press-down and release
times? At the moment, it just notifies the user of the key?

Because once you have sensitive to "length of press", I imagine that's just
the start of additional information you'd want about events and how they
relate in time to each other...

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#22163; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Dec 2015 17:50:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 13 12:50:21 2015
Received: from localhost ([127.0.0.1]:50365 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1a8Amr-0008Dm-5f
	for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 12:50:21 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38689)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <simonfv@HIDDEN>) id 1a82Tx-0002fp-6o
 for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 03:58:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a82Tq-0001wA-QM
 for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 03:58:11 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:52591)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a82Tq-0001w3-Me
 for submit <at> debbugs.gnu.org; Sun, 13 Dec 2015 03:58:10 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48682)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a82Tp-0007VH-Fq
 for bug-gnu-emacs@HIDDEN; Sun, 13 Dec 2015 03:58:10 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a82To-0001vP-8k
 for bug-gnu-emacs@HIDDEN; Sun, 13 Dec 2015 03:58:09 -0500
Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:35096)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <simonfv@HIDDEN>) id 1a82To-0001vJ-3G
 for bug-gnu-emacs@HIDDEN; Sun, 13 Dec 2015 03:58:08 -0500
Received: by qkfb125 with SMTP id b125so97453431qkf.2
 for <bug-gnu-emacs@HIDDEN>; Sun, 13 Dec 2015 00:58:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=c668SX+VBuDkaRoWCw0k4pQLIKUPtziJHlnFDqLPulU=;
 b=ljmuWHuqttiesREO4SurRaR2LXkaWq3XHxdn1xh/fwR+ZnHMK8PJ+SzV3WpnFrA1Ag
 +bSsUYSPiZu60SB9ltCugnHxwj2IuoIJ1mnlFpjGpMamNjTx//CBw81XYIf5xsO1cJfc
 KEW18UHjkhCiWmAEVU+65pLYF0EFNw0I4FvXeVXl4oTgvFaNUM9TmkhvMemRWudWErj6
 oKzzPYlIvdPtxn5qLvpjr+/PHJGM/6PanuBTfquHd/z+U98C2XFSoABMQO147brsdpeO
 ixn1YS/g/ethVwHEPrsRqeZGkCGJvGMXgf6Z6Mw+YQ71KGlKfT7s7IM/4rhreDHh3R5C
 JFZw==
MIME-Version: 1.0
X-Received: by 10.129.130.195 with SMTP id s186mr15244589ywf.257.1449997087325; 
 Sun, 13 Dec 2015 00:58:07 -0800 (PST)
Received: by 10.37.215.8 with HTTP; Sun, 13 Dec 2015 00:58:07 -0800 (PST)
Date: Sun, 13 Dec 2015 09:58:07 +0100
Message-ID: <CAGqLG_vE72KiBeUMbN8LMsokx9az1i4krzG=YyAQ0VozEyz6dg@HIDDEN>
Subject: Feature request: Add support for key release event
From: Simon Friis Vindum <simonfv@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary=94eb2c07efa650ca430526c3c1c7
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 13 Dec 2015 12:50:20 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

--94eb2c07efa650ca430526c3c1c7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Dear Emacs developers

I apologize if this feature has been requested before. I was not able to
find any such requests.

The feature request:
It should be possible to bind functions to the _release_ of a key.
Additionally it would also be nice if it was possible to get the current
state of a key. I.e. is it pressed or not.

As far is I understand implementing this in the terminal is impossible=E2=
=80=94so
this feature would be for graphical environments only.

Motivation:
Here are a few ideas that I've wanted to implement as Emacs extensions.
They all turned out to be impossible due to the lack of this feature. To
implement them it would be necessary to be notified both when a key is
pressed and when a keys is released.

1/ The possibility of bindings commands to the long press of a key. For
instance I would bind a long press of `s` to `isearch-forward` and a long
press of `n` to `avy-goto-line-below`. The extension would calculate this
time difference between key press and release. And based on that decide
between short- and long-press behaviour.

2/ An extension that would make it possible to use a regular key as a
modifier key. For instance holding `j` with the right hand could activate
"wasd" directional keys for the left hand. Or holding `a` could activate
vim-like directional keys with "hjkl". The possibilities are many.

3/ Get press and hold behaviour independent of the OSs key repeat
behaviour. If I bind a function (e.g. one that scrolls the buffer a single
line) to a key binding then the behaviour will be like this: initial press
scrolls one line. Then there is a long delay. After that a single line is
scrolled with very short delays. It is controlled entirely by how key
repeat works in the OS. Getting rid of the initial long delay or
controlling the repeat interval is impossible.

In my initial search for this feature I came across a bunch of
StackOverflow questions that also asked for behaviour that would require
this functionality. Often the best answer was to use key-chords. But the
semantics of pressing two keys quickly after each other is quite different
from the press-and-hold semantics of a modifier.

Thank you for considering this.

Kind regards
Simon Friis Vindum

--94eb2c07efa650ca430526c3c1c7
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div><div><div>Dear Emacs developers<br><br></di=
v><div>I apologize if this feature has been requested before. I was not abl=
e to find any such requests.<br></div><div><br>The feature request:<br>It s=
hould be possible to bind functions to=20
the _release_ of a key.<br>Additionally it would also be nice if it was pos=
sible to get the current=20
state of a key. I.e. is it pressed or not.<br><br>As far is I understand im=
plementing this in the=20
terminal is impossible=E2=80=94so this feature would be for graphical envir=
onments only.<br><br>Motivation:<br>Here are a few ideas that I&#39;ve want=
ed to implement as Emacs extensions. They all turned out to be impossible d=
ue to the lack of this feature. To implement them it would be necessary to =
be notified both when a key is=20
pressed and when a keys is released.<br><br>1/ The possibility of bindings =
commands to the long press of a key. For instance I would bind a long press=
 of `s` to `isearch-forward` and a long press of `n` to `avy-goto-line-belo=
w`. The extension would calculate this time difference between key press an=
d release. And based on that decide between short- and long-press behaviour=
.<br><br></div>2/ An extension that would make it possible to use a regular=
 key as a modifier key. For instance holding `j` with the right hand could =
activate &quot;wasd&quot; directional keys for the left hand. Or holding `a=
` could activate vim-like directional keys with &quot;hjkl&quot;. The possi=
bilities are many.<br><br></div>3/ Get press and hold behaviour independent=
 of the OSs key repeat behaviour. If I bind a function (e.g. one that scrol=
ls the buffer a single line) to a key binding then the behaviour will be li=
ke this: initial press scrolls one line. Then there is a long delay. After =
that a single line is scrolled with very short delays. It is controlled ent=
irely by how key repeat works in the OS. Getting rid of the initial long de=
lay or controlling the repeat interval is impossible.<br></div><br></div>In=
 my initial search for this feature I came across a bunch of StackOverflow =
questions that also asked for behaviour that would require this functionali=
ty. Often the best answer was to use key-chords. But the semantics of press=
ing two keys quickly after each other is quite different from the press-and=
-hold semantics of a modifier.<br><br></div><div>Thank you for considering =
this.<br></div><div><br></div><div>Kind regards<br></div><div>Simon Friis V=
indum<br></div></div>

--94eb2c07efa650ca430526c3c1c7--




Acknowledgement sent to Simon Friis Vindum <simonfv@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#22163; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.