GNU bug report logs - #72555
30.0.60; [PATCH] NS: support passing key events to the system

Previous Next

Package: emacs;

Reported by: Kai Ma <justksqsf <at> gmail.com>

Date: Sat, 10 Aug 2024 11:49:02 UTC

Severity: normal

Found in version 30.0.60

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Kai Ma <justksqsf <at> gmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.60; [PATCH] NS: support passing key events to the system
Date: Sat, 10 Aug 2024 13:47:48 +0200
[Message part 1 (text/plain, inline)]
The attached patch adds ns-pass-keys-to-system and makes Emacs to send
the key events to the system input manager when it's set.  This can
correct a number of problems that are hard to work around due to the
current key handling logic of Emacs NSport.

(1) The keydown event of Shift+Enter is never sent to the system input
method.  This causes an annoying problem for system input methods: if
you press Shift+Enter in Emacs (that is three events: Shift down,
Shift+Enter down, Shift up), the input method only sees Shift down and
up.  However, many input methods interprets a click of Shift differently
(mostly toggling ASCII mode), and this causes unwanted behavior.  (This
was reported as #38293 in 2019.)

This can only be fixed by Emacs, because to input methods, Shift+Enter
is indistinguishable from a single Shift.

(2) The input method may define some special keys and Emacs cannot make
use of them.

(3) Some system level shortcuts never work in Emacs.  For example,
Rectangle (think of it as a third-party window manager in macOS) will
not receive any requests from Emacs windows.

The fix is mostly modeled after Mitsuharu's Mac port, with a few
adjustments for NS port.  I've been using it for some time and there are
no more defects known to me, so I decide it's time to send it to you.

Regards,
Kai

[0001-NS-Pass-key-events-to-system-first.patch (application/octet-stream, attachment)]

This bug report was last modified 84 days ago.

Previous Next


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