From: Philipp Stephani <p.stephani2@gmail.com>
To: Anders Lindgren <andlind@gmail.com>
Cc: 21551@debbugs.gnu.org, Kai Yu Zhang <yeannylam@gmail.com>,
Mikhail Gusarov <dottedmag@dottedmag.net>
Subject: bug#21551: Fix Mac OS X key bindings bug
Date: Sun, 11 Feb 2018 17:57:32 +0000 [thread overview]
Message-ID: <CAArVCkQGUd8hMECL-hZGzH7j95GyoTfLhc2=MqxQPdgo9QEXQw@mail.gmail.com> (raw)
In-Reply-To: <CABr8ebZOi0sCEAEB9u+Hmat6R0nXEhhWbeZt1e_76v8A_TOApA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2838 bytes --]
Anders Lindgren <andlind@gmail.com> schrieb am Sa., 2. Jan. 2016 um
09:08 Uhr:
> I found a case where the code in question is needed, which none of the
> suggested patches handle correctly.
>
> Steps to repeat:
>
> (setq ns-alternate-modifier nil)
>
> Press left CMD-ALT-9
>
> An unmodified Emacs replies "s-]" is not bound. (This assumes a
> Swedish keyboard layout, other layouts would yield a different character,
> but the principle is the same).
>
> With either of the two patches, Emacs respond with "s-9" is not bound,
> which isn't correct.
>
In the current master this is now interpreted as M-s-9, which is at least
somewhat reasonable.
>
> Unfortunately, I don't know how to distinguish between the cases where we
> need to strip away modifiers (C-s-a) and when we shouldn't, so I'm leaving
> this open for now.
>
It seems like in the macOS input model, we can't: either we strip away all
modifiers, or none.
>
> -- Anders Lindgren
>
>
> On Wed, Dec 30, 2015 at 9:50 AM, Anders Lindgren <andlind@gmail.com>
> wrote:
>
>> Hi,
>>
>> I'm looking into a key binding bug on OS X reported multiple times
>> (19977, 21330, 21551). Two different patches have been submitted.
>>
>> The original code looks like:
>>
>> if (is_left_key)
>> {
>> emacs_event->modifiers |= parse_solitary_modifier
>> (ns_command_modifier);
>>
>> /* if super (default), take input manager's word so things like
>> dvorak / qwerty layout work */
>> if (EQ (ns_command_modifier, Qsuper)
>> && !fnKeysym
>> && [[theEvent characters] length] != 0)
>> {
>> /* XXX: the code we get will be unshifted, so if we have
>> a shift modifier, must convert ourselves */
>> if (!(flags & NSShiftKeyMask))
>> code = [[theEvent characters] characterAtIndex: 0];
>>
>> One of the patches simply removes the `if (EQ(...))' statement. The other
>> modifies the code to strip away modifiers.
>>
>> First question: What is the code in the `if (EQ(...))' supposed to do? In
>> other words, what will stop working if it is removed?
>>
>> Second question: if it is needed for the LEFT command key, should the
>> corresponding code be added for the RIGHT?
>>
>> I've tested removing the `if' and Emacs still seems to be working as
>> intended, both with a normal key layout and when Dvorak is used. If no one
>> comes up with a reason to keep the code, I will remove it.
>>
>> Third question: Does anybody know of a good way to automatically test
>> things like this? What I'm looking for is a way to send keystrokes like
>> Cmd-Alt-a to Emacs, that way it could be possible to write tests ensuring
>> that things like this don't break in the future.
>>
>> -- Anders Lindgren
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 4418 bytes --]
next prev parent reply other threads:[~2018-02-11 17:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 13:19 bug#21551: [PATCH] Fix Mac OS X key bindings bug Kai Yu Zhang
2015-12-30 8:50 ` bug#21551: " Anders Lindgren
2016-01-02 8:08 ` Anders Lindgren
2016-12-26 20:12 ` bug#19977: " Mikhail Gusarov
2018-02-11 17:57 ` Philipp Stephani [this message]
2018-02-13 18:56 ` bug#21551: " Alan Third
2018-02-14 21:44 ` Alan Third
2018-02-17 12:36 ` Alan Third
2018-02-18 21:59 ` Philipp Stephani
2018-02-19 15:05 ` Richard Stallman
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='CAArVCkQGUd8hMECL-hZGzH7j95GyoTfLhc2=MqxQPdgo9QEXQw@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=21551@debbugs.gnu.org \
--cc=andlind@gmail.com \
--cc=dottedmag@dottedmag.net \
--cc=yeannylam@gmail.com \
/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.