>From 8fbe6096fcb4ca37185120bc629a55741c8e15f5 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 24 Aug 2017 21:08:16 +0100 Subject: [PATCH] Correct "hide others" shortcut on macOS (bug#28215) * src/nsterm.m (EmacsView::keyDown): Remove code that forces system keymap when pressing cmd (super) key. * lisp/term/ns-win.el: Add new shortcut for ns-do-hide-others. --- lisp/term/ns-win.el | 1 + src/nsterm.m | 36 +----------------------------------- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 8848360655..776add98af 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -124,6 +124,7 @@ global-map (define-key global-map [?\s-g] 'isearch-repeat-forward) (define-key global-map [?\s-h] 'ns-do-hide-emacs) (define-key global-map [?\s-H] 'ns-do-hide-others) +(define-key global-map [?\M-\s-h] 'ns-do-hide-others) (define-key global-map [?\s-j] 'exchange-point-and-mark) (define-key global-map [?\s-k] 'kill-current-buffer) (define-key global-map [?\s-l] 'goto-line) diff --git a/src/nsterm.m b/src/nsterm.m index 22f8efd6b9..ccf7fd5238 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6106,41 +6106,7 @@ flag set (this is probably a bug in the OS). : ns_right_command_modifier); 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 & NSEventModifierFlagShift)) - code = [[theEvent characters] characterAtIndex: 0]; -#if 0 - /* this is ugly and also requires linking w/Carbon framework - (for LMGetKbdType) so for now leave this rare (?) case - undealt with.. in future look into CGEvent methods */ - else - { - long smv = GetScriptManagerVariable (smKeyScript); - Handle uchrHandle = GetResource - ('uchr', GetScriptVariable (smv, smScriptKeys)); - UInt32 dummy = 0; - UCKeyTranslate ((UCKeyboardLayout *) *uchrHandle, - [[theEvent characters] characterAtIndex: 0], - kUCKeyActionDisplay, - (flags & ~NSEventModifierFlagCommand) >> 8, - LMGetKbdType (), kUCKeyTranslateNoDeadKeysMask, - &dummy, 1, &dummy, &code); - code &= 0xFF; - } -#endif - } - } + emacs_event->modifiers |= parse_solitary_modifier (ns_command_modifier); is_right_key = (flags & NSRightControlKeyMask) == NSRightControlKeyMask; is_left_key = (flags & NSLeftControlKeyMask) == NSLeftControlKeyMask -- 2.12.0