From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#19977: 24.4; Incorrect translation of Super modifier with Ctrl or Meta on OS X Date: Tue, 29 Mar 2016 19:43:47 +0000 Message-ID: References: <83r3etwc9j.fsf@gnu.org> <83lh51w9z8.fsf@gnu.org> <83d1qdw7bt.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a8cacff9bc9052f353f25 X-Trace: ger.gmane.org 1459280728 12442 80.91.229.3 (29 Mar 2016 19:45:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2016 19:45:28 +0000 (UTC) Cc: 19977@debbugs.gnu.org To: Adrian Robert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 29 21:45:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1akzZk-0001XT-DL for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Mar 2016 21:45:16 +0200 Original-Received: from localhost ([::1]:49549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akzZg-0000vj-5e for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Mar 2016 15:45:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akzZb-0000sj-IQ for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2016 15:45:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akzZW-0007NB-MD for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2016 15:45:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akzZW-0007N6-IV for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2016 15:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1akzZW-0000ts-BD for bug-gnu-emacs@gnu.org; Tue, 29 Mar 2016 15:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Mar 2016 19:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19977-submit@debbugs.gnu.org id=B19977.14592806443378 (code B ref 19977); Tue, 29 Mar 2016 19:45:02 +0000 Original-Received: (at 19977) by debbugs.gnu.org; 29 Mar 2016 19:44:04 +0000 Original-Received: from localhost ([127.0.0.1]:44138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akzYa-0000sQ-Dy for submit@debbugs.gnu.org; Tue, 29 Mar 2016 15:44:04 -0400 Original-Received: from mail-lb0-f171.google.com ([209.85.217.171]:36439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akzYY-0000rp-Rd for 19977@debbugs.gnu.org; Tue, 29 Mar 2016 15:44:03 -0400 Original-Received: by mail-lb0-f171.google.com with SMTP id qe11so17817363lbc.3 for <19977@debbugs.gnu.org>; Tue, 29 Mar 2016 12:44:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z1ykpZANwpTsfJClg8nsAMJA9REvZGgkOj+NUU8K1eM=; b=j5ajGpQIhWsGseKfU7yiJqOYAn7KQyRwiO5QBMz5CHIctTDViPbhBxNspMx9+TACNs RmK+Vz8ZsQw29Ndc/V+pNS2GT4aSBjAmYSpaLD0iQAN9zSFYXUjyfg6IhAiB3lmWwOHh krEnrRXOQOHcBotskmhS3v+gWHRxY9ORpBAMQiCPABPZgj5zgKOgLxow4AB6fEE+js+C eRsdIVU+yPPWur0W5j/1Cz9Qg5sMggOxpcHLZNSSu51ydAmIPcZ1V2kviWpEC22A/lrs NMtS4m5PgWdOOijfL3xNGFaDP0/RhenhP7UNGQ7TilPUXzNND2Dm40dX/0NrtpygjbDe PxUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z1ykpZANwpTsfJClg8nsAMJA9REvZGgkOj+NUU8K1eM=; b=OfTkHB8LLz0435bkar0UowhsfHVCNkstqLj438IdhCHYopmxmkokQkHBhImrfqCmNC I745XM7Mpa4H7cbCYxYE5khhVbyU9p4NIRKGqJyTT9V3DJUiGDVDmOlmzBLMqW4tltE8 gfhFUyhVofZRcNb8UDr7oCpIrMVPNarQs4+DCLT3AVNprdCxhWybMYsM8F5cPCyhTxS8 gGej9Q6ik4il6Z/vr9uqtk7n9xC1ps7ad4UfLnJRHpNGVK+bC4JvQYM9mrFT2K7BwItw bwl7vULxtbBbkm9oOnknUmd7Yx+hHWa8fT1xQvsjkLhawTlo6aJtolsSPeEPWpaay4nk lGBw== X-Gm-Message-State: AD7BkJLvvKqyUzvVLiU+TcJfFZQUFiDgElJXKlYTvdSmjIjjsHQFZhAoBAocd3s8AOstR58Rh59tzTg6sIxSrw== X-Received: by 10.112.133.38 with SMTP id oz6mr1990245lbb.64.1459280637039; Tue, 29 Mar 2016 12:43:57 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115735 Archived-At: --047d7b3a8cacff9bc9052f353f25 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Adrian Robert schrieb am Di., 29. M=C3=A4rz 201= 6 um 19:56 Uhr: > > On 2016.3.29, at 20:44, Philipp Stephani wrote: > > > > > > > Adrian Robert schrieb am Di., 29. M=C3=A4rz= 2016 > um 19:19 Uhr: > > > > On 2016.3.29, at 19:57, Eli Zaretskii wrote: > > > > >> From: Philipp Stephani > > >> Date: Tue, 29 Mar 2016 16:38:52 +0000 > > >> Cc: 19977@debbugs.gnu.org > > >> > > >> If I comment out the if block below the comment > > >> > > >> /* if super (default), take input manager's word so things like > > >> dvorak / qwerty layout work */ > > >> > > >> in nsterm.m, everything works. Unless somebody can explain why that > if block exists at all (i.e. why > > >> [theEvent characters] instead of [theEvent > charactersIgnoringModifiers] is used), then I'd suggest to > > >> remove the block completely. > > >> > > >> Attached a patch to remove this code. > > > > > > Adrian, any comments? It's your code from 7 years ago. > > > > > > Heh, well of the top of my head=E2=80=A6 ;-) > > > > Did you try testing Dvorak / Qwerty layout? If not, that=E2=80=99s und= er System > Preferences, Keyboard, add new, English, select Dvorak or Dvorak / Qwerty= . > > > > From what I remember, the issue had to do with cmd-key shortcuts when > one of those layouts was in use. I think users were expecting the letter > reported for the cmd shortcut to either agree with or disagree with the > dvorak layout. Using [theEvent characters] caused it to use what they we= re > expecting. > > > > It sounds like either this wasn=E2=80=99t the right solution, or user > expectations vary. In either case I would agree with simplifying the cod= e > and removing the part you suggest. > > > > > > Yes, I can see what the problem is, thanks for the pointer. Basically i= n > a couple of layouts (there are others, e.g. "Gujarati - QUERTY"), Command > acts as shift-like character, like Option and Shift, selecting a differen= t > character, and not as a control-like character. For Option, Emacs allows > switching between shift-like and control-like behavior using the > `ns-alternate-modifier' option. The same should be implemented for Comman= d. > > However, the code for `ns-alternate-modifier' is also somewhat broken. > If it's set to 'none, C-M- doesn't work any more. This needs a bi= t > more thought. What exactly is supposed to happen if both a shift-like and= a > control-like modifier are pressed at the same time? Emacs is inconsistent > here: C-S-a remains C-S-a, but M-S-a gets translated to M-A. > > > I would say the correct behavior is to combine the modifier and the > =E2=80=9Cshift=E2=80=9Ded result. C-S-a should be C-A. But my memory is= fuzzy as to > whether nsterm should do this or it happens in emacs generic code. And i= f > ns-alternate-modifier is =E2=80=98none=E2=80=99, then there is no such th= ing as C-M-letter, > just C-letter, where the identify of =E2=80=98letter' is determined by wh= at comes > from opt-. > > > > > I agree that this behavior is the desired/expected one. Unfortunately it seems the NSEvent API makes this somewhat hard to implement: you can either ignore all modifiers except shift (using charactersIgnoringModifiers) or none (using characters), but we'd need to ignore a certain subset of the modifiers. --047d7b3a8cacff9bc9052f353f25 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Adrian= Robert <adrian.b.robert@gm= ail.com> schrieb am Di., 29. M=C3=A4rz 2016 um 19:56=C2=A0Uhr:

On 2016.3.29, at 20:44, Philipp Stephani <p.stephani2@gmail.com> wrote:

>
>
> Adrian Robert <adrian.b.robert@gmail.com> schrieb am Di., 29. M=C3=A4rz= 2016 um 19:19 Uhr:
>
> On 2016.3.29, at 19:57, Eli Zaretskii <eliz@gnu.org> wrote:
>
> >> From: Philipp Stephani <p.stephani2@gmail.com>
> >> Date: Tue, 29 Mar 2016 16:38:52 +0000
> >> Cc: 19977@debbugs.gnu.org
> >>
> >> If I comment out the if block below the comment
> >>
> >> /* if super (default), take input manager's word so thing= s like
> >> dvorak / qwerty layout work */
> >>
> >> in nsterm.m, everything works. Unless somebody can explain wh= y that if block exists at all (i.e. why
> >> [theEvent characters] instead of [theEvent charactersIgnoring= Modifiers] is used), then I'd suggest to
> >> remove the block completely.
> >>
> >> Attached a patch to remove this code.
> >
> > Adrian, any comments?=C2=A0 It's your code from 7 years ago.<= br> >
>
> Heh, well of the top of my head=E2=80=A6 ;-)
>
> Did you try testing Dvorak / Qwerty layout?=C2=A0 If not, that=E2=80= =99s under System Preferences, Keyboard, add new, English, select Dvorak or= Dvorak / Qwerty.
>
> From what I remember, the issue had to do with cmd-key shortcuts when = one of those layouts was in use.=C2=A0 I think users were expecting the let= ter reported for the cmd shortcut to either agree with or disagree with the= dvorak layout.=C2=A0 Using [theEvent characters] caused it to use what the= y were expecting.
>
> It sounds like either this wasn=E2=80=99t the right solution, or user = expectations vary.=C2=A0 In either case I would agree with simplifying the = code and removing the part you suggest.
>
>
> Yes, I can see what the problem is, thanks for the pointer. Basically = in a couple of layouts (there are others, e.g. "Gujarati - QUERTY"= ;), Command acts as shift-like character, like Option and Shift, selecting = a different character, and not as a control-like character. For Option, Ema= cs allows switching between shift-like and control-like behavior using the = `ns-alternate-modifier' option. The same should be implemented for Comm= and.
> However, the code for `ns-alternate-modifier' is also somewhat bro= ken. If it's set to 'none, C-M-<letter> doesn't work any = more. This needs a bit more thought. What exactly is supposed to happen if = both a shift-like and a control-like modifier are pressed at the same time?= Emacs is inconsistent here: C-S-a remains C-S-a, but M-S-a gets translated= to M-A.


I would say the correct behavior is to combine the modifier and the =E2=80= =9Cshift=E2=80=9Ded result.=C2=A0 C-S-a should be C-A.=C2=A0 But my memory = is fuzzy as to whether nsterm should do this or it happens in emacs generic= code.=C2=A0 And if ns-alternate-modifier is =E2=80=98none=E2=80=99, then t= here is no such thing as C-M-letter, just C-letter, where the identify of = =E2=80=98letter' is determined by what comes from opt-<original-key&= gt;.





I agree that this behavior is the desi= red/expected one. Unfortunately it seems the NSEvent API makes this somewha= t hard to implement: you can either ignore all modifiers except shift (usin= g charactersIgnoringModifiers) or none (using characters), but we'd nee= d to ignore a certain subset of the modifiers.
--047d7b3a8cacff9bc9052f353f25--