GNU bug report logs - #74423
Low level key events

Previous Next

Package: emacs;

Reported by: Cecilio Pardo <cpardo <at> imayhem.com>

Date: Mon, 18 Nov 2024 20:36:02 UTC

Severity: wishlist

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Cecilio Pardo <cpardo <at> imayhem.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Low level key events
Date: Mon, 18 Nov 2024 21:35:40 +0100
[Message part 1 (text/plain, inline)]
Here is a still incomplete patch for this, renamed from "physical 
keyboard events", following up to
https://lists.gnu.org/archive/html/emacs-devel/2024-11/msg00085.html

It provides events for press/release of keys, independently of the 
normal keyboard events. These events are bound int the 
special-event-map. Some lisp is included to implement detection of 
multiple tapping on keys, and running commands or simulating modifiers.

Currently, only modifier keys are available, because other keys would 
send their own normal event. This could change when an use case for 
other keys appears.

To provide events for 'logical' modifiers Ctrl, Meta, etc., now there is 
a new event low-level-modifier, in addition to low-level-key. If you 
press Shift_L, two events will be generated, one for 'shift as 
low-level-modifier, and one for 'lshift as low-level-key. The lisp part 
handles those events separately.

I added a variable that enables/disables everything, 
enable-low-level-key-events.

This are some of Po Lu's notes on the previous patch:

> [...] Emacs must not depend on XKB for such a basic feature.

Fixed.

> Please find some means of generating such events by saving them into the
> keyboard event buffer defined in handle_ome_xevent.

As we may generate two events, that is not possible.

> x_filter_events is not the proper location for this call.  It is only
> invoked to filter an event through the active GTK or X input method
> context, and it is not invoked if Emacs is configured not to open input
> method contexts, or they are unavailable by happenstance.

Done. If XINPUT is enabled, the XI_KeyPress event used, over the gtk 
one. If not, the gtk event is used unless there is no input method. In 
this case KeyPress event is used.

The pgtk version is not updated.




[0001-Add-events-for-key-press-and-key-release-on-gui-syst.patch (text/plain, attachment)]

This bug report was last modified 46 days ago.

Previous Next


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