unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22163: Feature request: Add support for key release event
@ 2015-12-13  8:58 Simon Friis Vindum
  2015-12-14 22:17 ` John Wiegley
  2015-12-15 20:15 ` Simon Friis Vindum
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Friis Vindum @ 2015-12-13  8:58 UTC (permalink / raw)
  To: 22163

[-- Attachment #1: Type: text/plain, Size: 2263 bytes --]

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—so
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

[-- Attachment #2: Type: text/html, Size: 2466 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-15 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-13  8:58 bug#22163: Feature request: Add support for key release event Simon Friis Vindum
2015-12-14 22:17 ` John Wiegley
2015-12-15 20:15 ` Simon Friis Vindum
2015-12-15 20:27   ` John Wiegley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).