[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] On the nasty "ghost key" problem on NS

From: Po Lu
Subject: Re: [PATCH] On the nasty "ghost key" problem on NS
Date: Fri, 04 Nov 2022 08:32:53 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Kai Ma <justksqsf@gmail.com> writes:

> Hi all,
> Attached is a one-liner patch to the “ghost key” problem on NS. (The name is 
> made up by me.) I didn’t have luck finding a bug report (but it did happen to 
> many to-be-liberated Mac users [1-3]), so I decided to directly send it here.
> On certain occasions (*), the key event buffer is not cleared to be
> empty even if the events have been processed. This results in a nasty
> problem: when you press a key, say “y”, a key that is pressed earlier
> will be prepended to the current key. There’s no way to reset the
> event buffer.
> This problem is highly unpredictable, making it very hard to reproduce. A 
> probably quicker way: hack Emacs’ C codebase with corfu-auto and citre-mode.
> (*) The root cause is still not clear to me. It’s observed that
> sometimes, the [interpretKeyEvents] call seems not to return. (Blocked
> inside Cocoa?) And the supposedly matched “remove” is never
> called. Now “nsEvArray” is left with an earlier keyDown event, and
> since “nsEvArray” is static, you have the problem as described
> above. I guess it may be some Cocoa internal changes that caused this.
> This patch is just a workaround, but it improves the current user experience 
> a bit.

I am sorry, but this patch breaks compose processing.  So we're
certainly not installing anything like this in Emacs 29.

I will try to figure out a way to reproduce the bug and why it actually

reply via email to

[Prev in Thread] Current Thread [Next in Thread]