all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Cecilio Pardo <cpardo@imayhem.com>
Cc: emacs-devel@gnu.org
Subject: Re: Physical keyboard events
Date: Tue, 29 Oct 2024 18:44:36 +0200	[thread overview]
Message-ID: <86froe6eq3.fsf@gnu.org> (raw)
In-Reply-To: <e1d6e514-f96f-410f-b5fa-eed27dace193@imayhem.com> (message from Cecilio Pardo on Tue, 29 Oct 2024 16:07:16 +0100)

> Date: Tue, 29 Oct 2024 16:07:16 +0100
> Cc: emacs-devel@gnu.org
> From: Cecilio Pardo <cpardo@imayhem.com>
> 
> On 29/10/2024 14:40, Eli Zaretskii wrote:
> 
> >> I'm planning to implement physical key press/release events for emacs.
> >> I would add a new element to 'enum event_kind', that in turn would
> >> send a new input event. This input event will be bound in
> >> 'special-event-map' so that it will not modify the normal flow of
> >> keyboard input. Platform dependent code would send these events
> >> on key press and release.
> > 
> > I hope these new events will not be sent at all times, only when some
> > optional variable is set (similar to track-mouse, perhaps).  I
> > wouldn't want Emacs to start processing press/release events on Shift
> > or Ctrl unless a Lisp program needs that, and I don't think we want to
> > change our processing of keyboard such that instead of a single
> > keypress with modifiers we need to process multiple key-press and
> > key-release events when the user simply types on the keyboard.
> 
> Thats why the events will be bound in special-event-map. Nobody will see 
> them, except for the code that handles them.  We can of course 
> completely disable them with a variable.

Even if no one sees them, bombarding the Emacs event queue with
useless events will have its effect: Emacs will become more sluggish,
some while-no-input loops will unexpectedly exit just because the user
happened to touch the Shift key for some reason, etc.

> > Physical keys also raise the issue of supporting input methods,
> > keyboard layout switches, etc.
> 
> I will define a list of keys: LeftShit, RightShift, LeftControl, etc. 
> The platform dependent code will decide which one was pressed. As events 
> will be invisible, I don't think we will interfere with input methods.

I meant the non-modifier keys.  When some OS feature redefines a key,
low-level events will not know that, and will still consider the key
labeled 'a' as 'a', even though I might have switched the keyboard to
another language, where the key labeled 'a' actually produces a
completely different character, say, 'ש'.

> > However, on what systems and which Emacs configurations will it be
> > possible to provide such a feature?
> 
> I think all GUI systems can use this.

So X (with or without any toolkit we support), PGTK, MS-Windows, and
macOS -- all those let applications access low-level key events?




  parent reply	other threads:[~2024-10-29 16:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 23:15 Physical keyboard events Cecilio Pardo
2024-10-29 13:40 ` Eli Zaretskii
2024-10-29 15:07   ` Cecilio Pardo
2024-10-29 15:38     ` Peter Feigl
2024-10-29 17:54       ` Cecilio Pardo
2024-10-29 23:41       ` James Thomas
2024-10-29 16:44     ` Eli Zaretskii [this message]
2024-10-29 16:55       ` Yuri Khan
2024-10-29 17:46         ` Eli Zaretskii
2024-10-30  2:56           ` Max Nikulin
2024-10-30  6:28             ` Yuri Khan
2024-10-30  6:39               ` Peter Feigl
2024-10-30 15:27               ` Eli Zaretskii
2024-10-30 17:13                 ` Yuri Khan
2024-10-30 15:21             ` Eli Zaretskii
2024-10-29 17:56         ` Cecilio Pardo
2024-10-29 17:52       ` Cecilio Pardo
2024-10-29 17:13 ` Alan Mackenzie
2024-10-29 18:20   ` Cecilio Pardo
2024-10-29 19:31     ` Alan Mackenzie
2024-10-29 21:45       ` Cecilio Pardo
2024-10-30  6:02         ` Yuri Khan
2024-10-30 15:23           ` Eli Zaretskii
2024-10-30 16:51             ` Yuri Khan
2024-10-30  3:27       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86froe6eq3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cpardo@imayhem.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.