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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#72555: closed (30.0.60; [PATCH] NS: support passing key
 events to the system)
Date: Sun, 23 Feb 2025 00:28:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 23 Feb 2025 00:26:53 +0000
with message-id <CADwFkmkvOh3izKrgaV0qNbTANyxU648DcRmL=oqG0q2FZyd2Kw <at> mail.gmail.com>
and subject line Re: bug#72555: 30.0.60; [PATCH] NS: support passing key events to the system
has caused the debbugs.gnu.org bug report #72555,
regarding 30.0.60; [PATCH] NS: support passing key events to the system
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
72555: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72555
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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 3 (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)]
[Message part 5 (message/rfc822, inline)]
From: Stefan Kangas <stefankangas <at> gmail.com>
To: Kai Ma <justksqsf <at> gmail.com>
Cc: 72555-done <at> debbugs.gnu.org
Subject: Re: bug#72555: 30.0.60;
 [PATCH] NS: support passing key events to the system
Date: Sun, 23 Feb 2025 00:26:53 +0000
Kai Ma <justksqsf <at> gmail.com> writes:

> Sorry, I don’t have the capacity to work on this for the next months. Please close it. I’ll resubmit a patch if I ever sort this out in the future.
>
> According to my memories, the remaining problems are:
>
> 1. C-/ causes an unconditional beep because macOS has no default keybinding for it.
> 2. C-q is intercepted by Cocoa’s own quoted insert.
>
> We can simply handle them inside Emacs, but I’m not sure whether the list is complete.

OK, I'm therefore closing this bug report for now.

Please report back if you make any further progress with this.

Thanks in advance.


This bug report was last modified 85 days ago.

Previous Next


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