A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00185.html below:

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Kai Ma Subject: [PATCH] On the nasty "ghost key" problem on NS Date: Fri, 4 Nov 2022 02:07:39 +0800
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.

Regards
Kai

[1] https://emacs-china.org/t/emacs-rime-e/20286
[2] https://emacs-china.org/t/emacs/15430
[3] https://emacs-china.org/t/topic/13207

trace.org
Description: Binary data

fix-ghost-key.patch
Description: Binary data


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4