GNU bug report logs - #34984
ns-right-command-modifier has influence to left

Previous Next

Package: emacs;

Reported by: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Date: Mon, 25 Mar 2019 00:59:01 UTC

Severity: normal

To reply to this bug, email your comments to 34984 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#34984; Package emacs. (Mon, 25 Mar 2019 00:59:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 Mar 2019 00:59:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Cc: tkk <at> misasa.okayama-u.ac.jp
Subject: ns-right-command-modifier has influence to left
Date: Mon, 25 Mar 2019 09:57:37 +0900 (JST)
On macOS, assignment for left-command key is controlled
by that for right-command key.

  GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31
  macOS Mojave 10.14.3
  Mac mini (2018)
  
  /Applications/Emacs.app/Contents/MacOS/Emacs -Q
  C-h k leftcommand-x
  s-x runs the command kill-region (found in global-map),...
  M-: (setq ns-right-command-modifier 'meta)
  C-h k leftcommand-x
  M-x runs the command execute-extended-command (found in global-map),...

This does not happen with Mac mini (2012) with other parameters and
the same keyboard.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34984; Package emacs. (Mon, 25 Mar 2019 21:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 34984 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
Cc: 34984 <at> debbugs.gnu.org
Subject: Re: bug#34984: ns-right-command-modifier has influence to left
Date: Mon, 25 Mar 2019 21:41:55 +0000
On Mon, Mar 25, 2019 at 09:57:37AM +0900, Tak Kunihiro wrote:
> On macOS, assignment for left-command key is controlled
> by that for right-command key.
> 
>   GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31
>   macOS Mojave 10.14.3
>   Mac mini (2018)
>   
>   /Applications/Emacs.app/Contents/MacOS/Emacs -Q
>   C-h k leftcommand-x
>   s-x runs the command kill-region (found in global-map),...
>   M-: (setq ns-right-command-modifier 'meta)
>   C-h k leftcommand-x
>   M-x runs the command execute-extended-command (found in global-map),...
> 
> This does not happen with Mac mini (2012) with other parameters and
> the same keyboard.

Hi Tak, some questions:

Can you replicate the issue with the master branch? The modifier
handling has been almost completely rewritten in it.

Does the right command key work correctly?

Do you use any third‐party key remapping software?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34984; Package emacs. (Tue, 26 Mar 2019 03:47:01 GMT) Full text and rfc822 format available.

Message #11 received at 34984 <at> debbugs.gnu.org (full text, mbox):

From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: Alan Third <alan <at> idiocy.org>
Cc: 国広卓也 <tkk <at> misasa.okayama-u.ac.jp>,
 34984 <at> debbugs.gnu.org
Subject: Re: bug#34984: ns-right-command-modifier has influence to left
Date: Tue, 26 Mar 2019 12:46:18 +0900
Dear Alan,

> Can you replicate the issue with the master branch?
> The modifier handling has been almost completely rewritten in it.

I tested on 27.0.50.  The results are the same.


> Does the right command key work correctly?

It does not work correctly.  Even after (setq ns-right-command-modifier ‘meta),
`rightcommand-x’ gives `s-x’.


> Do you use any third‐party key remapping software?


I connected USB keyboard not specifically designed for macOS.
I swap `Option Key' and `Command Key’ using on Keyboard panel 
in System Preferences.  I do not use third-party key remapping
software.


Tak


GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.5.0, NS appkit-1671.40 Version 10.14.4 (Build 18E226))
 of 2019-03-26
macOS Mojave 10.14.4
Mac mini (2018)


 ~/Downloads/emacs/nextstep/Emacs.app/Contents/MacOS/Emacs -Q
 C-h k leftcommand-x
 s-x runs the command kill-region (found in global-map),...
 c-h k rightcommand-x
 s-x runs the command kill-region (found in global-map),...

 M-: (setq ns-right-command-modifier 'meta)
 C-h k leftcommand-x
 M-x runs the command execute-extended-command (found in global-map),...
 c-h k rightcommand-x
 s-x runs the command kill-region (found in global-map), ...


> On Mar 26, 2019, at 06:41, Alan Third <alan <at> idiocy.org> wrote:
> 
> On Mon, Mar 25, 2019 at 09:57:37AM +0900, Tak Kunihiro wrote:
>> On macOS, assignment for left-command key is controlled
>> by that for right-command key.
>> 
>>  GNU Emacs 26.1 (build 1, x86_64-apple-darwin14.5.0, NS appkit-1348.17 Version 10.10.5 (Build 14F2511)) of 2018-05-31
>>  macOS Mojave 10.14.3
>>  Mac mini (2018)
>> 
>>  /Applications/Emacs.app/Contents/MacOS/Emacs -Q
>>  C-h k leftcommand-x
>>  s-x runs the command kill-region (found in global-map),...
>>  M-: (setq ns-right-command-modifier 'meta)
>>  C-h k leftcommand-x
>>  M-x runs the command execute-extended-command (found in global-map),...
>> 
>> This does not happen with Mac mini (2012) with other parameters and
>> the same keyboard.
> 
> Hi Tak, some questions:
> 
> Can you replicate the issue with the master branch? The modifier
> handling has been almost completely rewritten in it.
> 
> Does the right command key work correctly?
> 
> Do you use any third‐party key remapping software?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34984; Package emacs. (Thu, 28 Mar 2019 21:53:01 GMT) Full text and rfc822 format available.

Message #14 received at 34984 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
Cc: 34984 <at> debbugs.gnu.org
Subject: Re: bug#34984: ns-right-command-modifier has influence to left
Date: Thu, 28 Mar 2019 21:52:29 +0000
On Tue, Mar 26, 2019 at 12:46:18PM +0900, Tak Kunihiro wrote:
> Dear Alan,
> 
> > Can you replicate the issue with the master branch?
> > The modifier handling has been almost completely rewritten in it.
> 
> I tested on 27.0.50.  The results are the same.

Thanks.

> I connected USB keyboard not specifically designed for macOS.
> I swap `Option Key' and `Command Key’ using on Keyboard panel 
> in System Preferences.  I do not use third-party key remapping
> software.

I can replicate this. The key is to swap command and option. I also
see it using my swapped caps lock ‐> ctrl. It shows up as right
control when I would expect it to be left.

Unfortunately I’m not sure what we can do about it. I don’t think we
have any way of determining whether the keys have been swapped. And
even if we did, whether the keyboard is a USB one.

Someone with an Apple developer account could raise it on radar, but
as the keycodes we’re using to determine left vs right are unofficial
I don’t know if Apple would do anything.

For the record the Mac port has the same issue.

Sorry, I can’t think of any way round it.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34984; Package emacs. (Fri, 29 Mar 2019 08:36:02 GMT) Full text and rfc822 format available.

Message #17 received at 34984 <at> debbugs.gnu.org (full text, mbox):

From: Nick Helm <nick <at> tenpoint.co.nz>
To: Alan Third <alan <at> idiocy.org>
Cc: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>,
 "34984 <at> debbugs.gnu.org" <34984 <at> debbugs.gnu.org>
Subject: Re: bug#34984: ns-right-command-modifier has influence to left
Date: Fri, 29 Mar 2019 08:35:28 +0000
Alan Third <alan <at> idiocy.org> writes:

> I can replicate this. The key is to swap command and option. I also
> see it using my swapped caps lock ‐> ctrl. It shows up as right
> control when I would expect it to be left.
>
> Unfortunately I’m not sure what we can do about it. 

This only seems to happen when the modifiers are swapped using System
Preferences. On my machine the problem goes away if I remap using
another method. 

Try putting the modifiers back to their defaults in System Preferemces
then running the following command (this swaps events left_alt and
left_gui, and right_alt and right_gui). Note that this won't survive
reboot.

$ hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x7000000E2,"HIDKeyboardModifierMappingDst":0x7000000E3},{"HIDKeyboardModifierMappingSrc":0x7000000E3,"HIDKeyboardModifierMappingDst":0x7000000E2},{"HIDKeyboardModifierMappingSrc":0x7000000E6,"HIDKeyboardModifierMappingDst":0x7000000E7},{"HIDKeyboardModifierMappingSrc":0x7000000E7,"HIDKeyboardModifierMappingDst":0x7000000E6}]}'

You can probably do similar tricks with karabiner and other key
remappers. 

Nick

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#34984; Package emacs. (Fri, 29 Mar 2019 08:43:01 GMT) Full text and rfc822 format available.

Message #20 received at 34984 <at> debbugs.gnu.org (full text, mbox):

From: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>
To: alan <at> idiocy.org
Cc: tkk <at> misasa.okayama-u.ac.jp, 34984 <at> debbugs.gnu.org
Subject: Re: bug#34984: ns-right-command-modifier has influence to left
Date: Fri, 29 Mar 2019 17:42:02 +0900 (JST)
>> > Can you replicate the issue with the master branch?
>> > The modifier handling has been almost completely rewritten in it.
>> 
>> I tested on 27.0.50.  The results are the same.
> 
> Thanks.
> 
>> I connected USB keyboard not specifically designed for macOS.
>> I swap `Option Key' and `Command Key’ using on Keyboard panel 
>> in System Preferences.  I do not use third-party key remapping
>> software.
> 
> I can replicate this. The key is to swap command and option. I also
> see it using my swapped caps lock ‐> ctrl. It shows up as right
> control when I would expect it to be left.
> 
> For the record the Mac port has the same issue.
> 
> Sorry, I can’t think of any way round it.

I'm okay.  I wanted the right-command key acts as Apple key when I
have to switch between Excel and Emacs 100 times but such opportunity
is very rare.

Thank you to take a look of the problem.  I will keep trying to
report problems of Emacs on macOS.




This bug report was last modified 6 years and 80 days ago.

Previous Next


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