all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kumaran Santhanam <kumaran@alumni.stanford.org>
To: 14736@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)	[thread overview]
Message-ID: <1832345773.5319.1372382464778.JavaMail.root@nerur.com> (raw)
In-Reply-To: <177174145.5314.1372381840342.JavaMail.root@nerur.com>

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''





       reply	other threads:[~2013-06-28  1:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <177174145.5314.1372381840342.JavaMail.root@nerur.com>
2013-06-28  1:21 ` Kumaran Santhanam [this message]
2016-05-31 20:41   ` bug#14736: 24.3; "Insert" key results in question mark mouse cursor and does not send a keyboard event Alan Third
2021-07-15  6:02     ` Lars Ingebrigtsen
2021-07-25 11:36       ` Alan Third
2021-07-28 15:43         ` Lars Ingebrigtsen
2021-07-30 18:19           ` Alan Third
2021-08-29 20:23             ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1832345773.5319.1372382464778.JavaMail.root@nerur.com \
    --to=kumaran@alumni.stanford.org \
    --cc=14736@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.