GNU bug report logs - #14736
24.3; "Insert" key results in question mark mouse cursor and does not send a keyboard event

Previous Next

Package: emacs;

Reported by: Kumaran Santhanam <kumaran <at> alumni.stanford.org>

Date: Fri, 28 Jun 2013 01:26:02 UTC

Severity: normal

Tags: confirmed, moreinfo

Found in version 24.3

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kumaran Santhanam <kumaran <at> alumni.stanford.org>
To: 14736 <at> debbugs.gnu.org
Subject: bug#14736: 24.3; "Insert" key results in question mark mouse cursor and does not send a keyboard event
Date: Thu, 27 Jun 2013 18:21:04 -0700 (PDT)
On Mac OS X, the "Insert" key on external keyboards is mapped to "Help".  Therefore, when the "Insert" key is pressed, the mouse cursor turns into a question mark and the key is not passed to Emacs to process.  This is problematic because users may have keybindings from Linux and Windows that make use of the "Insert" key.

The VIM project was able to resolve this issue by using the following code in the sendEvent method:

<code>
    // HACK! Intercept 'help' key presses and clear the 'help key flag', else
    // Cocoa turns the mouse cursor into a question mark and goes into 'context
    // help mode' (the keyDown: event itself never reaches the text view).  By
    // clearing the 'help key flag' this event will be treated like a normal
    // key event.
    if ((NSKeyDown == type || NSKeyUp == type) && (flags & NSHelpKeyMask)) {
        flags &= ~NSHelpKeyMask;
        event = [NSEvent keyEventWithType:[event type]
                                 location:[event locationInWindow]
                            modifierFlags:flags
                                timestamp:[event timestamp]
                             windowNumber:[event windowNumber]
                                  context:[event context]
                               characters:[event characters]
              charactersIgnoringModifiers:[event charactersIgnoringModifiers]
                                isARepeat:[event isARepeat]
                                  keyCode:[event keyCode]];
</code>

The full source is here:
https://code.google.com/p/macvim/source/browse/trunk/MMApplication.m

It would be a great benefit to users if this patch could be included in the upcoming point release.

Thanks,
Kumaran


-----


In GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-03-12 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin'
 '--with-ns' 'build_alias=i686-apple-darwin'
 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.7
 -isystem
 /Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/
 -F/Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks''




This bug report was last modified 3 years and 322 days ago.

Previous Next


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