[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r102462: Add separate key mappings fo
From: |
Jan D. |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r102462: Add separate key mappings for left/right control/command on Nextstep (Bug#7458). |
Date: |
Sun, 21 Nov 2010 14:09:34 +0100 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 102462
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sun 2010-11-21 14:09:34 +0100
message:
Add separate key mappings for left/right control/command on Nextstep
(Bug#7458).
* lisp/cus-start.el (all): Add ns-right-control-modifier and
ns-right-command-modifier.
* lisp/term/ns-win.el (ns-right-control-modifier)
(ns-right-command-modifier): Defvar them.
* src/nsterm.m (ns_right_command_modifier, ns_right_control_modifier):
Define (Bug#7458).
(NSRightCommandKeyMask, NSRightControlKeyMask): Define (Bug#7458).
(EV_MODIFIERS): Check for NSRightCommandKeyMask and
NSRightControlKeyMask also (Bug#7458).
(keyDown): Ditto (Bug#7458).
(syms_of_nsterm): Defvar ns-right-command-modifier and
ns-right-control-modifier (Bug#7458).
modified:
lisp/ChangeLog
lisp/cus-start.el
lisp/term/ns-win.el
src/ChangeLog
src/nsterm.m
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2010-11-20 22:27:56 +0000
+++ b/lisp/ChangeLog 2010-11-21 13:09:34 +0000
@@ -1,3 +1,11 @@
+2010-11-21 Jan Djärv <address@hidden>
+
+ * term/ns-win.el (ns-right-control-modifier)
+ (ns-right-command-modifier): Defvar them.
+
+ * cus-start.el (all): Add ns-right-control-modifier and
+ ns-right-command-modifier (Bug#7458).
+
2010-11-20 Glenn Morris <address@hidden>
* emacs-lisp/authors.el (authors-ignored-files)
=== modified file 'lisp/cus-start.el'
--- a/lisp/cus-start.el 2010-10-31 22:47:12 +0000
+++ b/lisp/cus-start.el 2010-11-21 13:09:34 +0000
@@ -320,12 +320,28 @@
(const control) (const meta)
(const alt) (const hyper)
(const super)) "23.1")
+ (ns-right-control-modifier
+ ns
+ (choice (const :tag "No modifier (work as control)" none)
+ (const :tag "Use the value of ns-control-modifier"
+ left)
+ (const control) (const meta)
+ (const alt) (const hyper)
+ (const super)) "24.0")
(ns-command-modifier
ns
(choice (const :tag "No modifier" nil)
(const control) (const meta)
(const alt) (const hyper)
(const super)) "23.1")
+ (ns-right-command-modifier
+ ns
+ (choice (const :tag "No modifier (work as command)" none)
+ (const :tag "Use the value of ns-command-modifier"
+ left)
+ (const control) (const meta)
+ (const alt) (const hyper)
+ (const super)) "24.0")
(ns-alternate-modifier
ns
(choice (const :tag "No modifier (work as alternate/option)" none)
=== modified file 'lisp/term/ns-win.el'
--- a/lisp/term/ns-win.el 2010-10-28 07:05:00 +0000
+++ b/lisp/term/ns-win.el 2010-11-21 13:09:34 +0000
@@ -179,7 +179,9 @@
(defvaralias 'mac-allow-anti-aliasing 'ns-antialias-text)
(defvaralias 'mac-command-modifier 'ns-command-modifier)
+(defvaralias 'mac-right-command-modifier 'ns-right-command-modifier)
(defvaralias 'mac-control-modifier 'ns-control-modifier)
+(defvaralias 'mac-right-control-modifier 'ns-right-control-modifier)
(defvaralias 'mac-option-modifier 'ns-option-modifier)
(defvaralias 'mac-right-option-modifier 'ns-right-option-modifier)
(defvaralias 'mac-function-modifier 'ns-function-modifier)
@@ -514,6 +516,8 @@
;; nsterm.m
(defvar ns-alternate-modifier)
(defvar ns-right-alternate-modifier)
+(defvar ns-right-command-modifier)
+(defvar ns-right-control-modifier)
;; You say tomAYto, I say tomAHto..
(defvaralias 'ns-option-modifier 'ns-alternate-modifier)
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-11-21 05:39:01 +0000
+++ b/src/ChangeLog 2010-11-21 13:09:34 +0000
@@ -1,3 +1,14 @@
+2010-11-21 Jan Djärv <address@hidden>
+
+ * nsterm.m (ns_right_command_modifier, ns_right_control_modifier):
+ Define (Bug#7458).
+ (NSRightCommandKeyMask, NSRightControlKeyMask): Define (Bug#7458).
+ (EV_MODIFIERS): Check for NSRightCommandKeyMask and
+ NSRightControlKeyMask also (Bug#7458).
+ (keyDown): Ditto (Bug#7458).
+ (syms_of_nsterm): Defvar ns-right-command-modifier and
+ ns-right-control-modifier (Bug#7458).
+
2010-11-21 Dan Nicolaescu <address@hidden>
* sysdep.c (sys_subshell): Remove SET_EMACS_PRIORITY.
=== modified file 'src/nsterm.m'
--- a/src/nsterm.m 2010-11-06 08:28:31 +0000
+++ b/src/nsterm.m 2010-11-21 13:09:34 +0000
@@ -158,10 +158,20 @@
Lisp_Object ns_command_modifier;
/* Specifies which emacs modifier should be generated when NS receives
+ the right Command modifier. Has same values as ns_command_modifier plus
+ the value Qleft which means whatever value ns_command_modifier has. */
+Lisp_Object ns_right_command_modifier;
+
+/* Specifies which emacs modifier should be generated when NS receives
the Control modifier. May be any of the modifier lisp symbols. */
Lisp_Object ns_control_modifier;
/* Specifies which emacs modifier should be generated when NS receives
+ the right Control modifier. Has same values as ns_control_modifier plus
+ the value Qleft which means whatever value ns_control_modifier has. */
+Lisp_Object ns_right_control_modifier;
+
+/* Specifies which emacs modifier should be generated when NS receives
the Function modifier (laptops). May be any of the modifier lisp symbols.
*/
Lisp_Object ns_function_modifier;
@@ -224,6 +234,8 @@
/* Convert modifiers in a NeXTSTEP event to emacs style modifiers. */
#define NS_FUNCTION_KEY_MASK 0x800000
#define NSRightAlternateKeyMask (0x000040 | NSAlternateKeyMask)
+#define NSRightControlKeyMask (0x002000 | NSControlKeyMask)
+#define NSRightCommandKeyMask (0x000010 | NSCommandKeyMask)
#define EV_MODIFIERS(e) \
((([e modifierFlags] & NSHelpKeyMask) ? \
hyper_modifier : 0) \
@@ -235,10 +247,18 @@
parse_solitary_modifier (ns_alternate_modifier) : 0) \
| (([e modifierFlags] & NSShiftKeyMask) ? \
shift_modifier : 0) \
+ | (!EQ (ns_right_control_modifier, Qleft) && \
+ (([e modifierFlags] & NSRightControlKeyMask) \
+ == NSRightControlKeyMask) ? \
+ parse_solitary_modifier (ns_right_control_modifier) : 0) \
| (([e modifierFlags] & NSControlKeyMask) ? \
parse_solitary_modifier (ns_control_modifier) : 0) \
| (([e modifierFlags] & NS_FUNCTION_KEY_MASK) ? \
parse_solitary_modifier (ns_function_modifier) : 0) \
+ | (!EQ (ns_right_command_modifier, Qleft) && \
+ (([e modifierFlags] & NSRightCommandKeyMask) \
+ == NSRightCommandKeyMask) ? \
+ parse_solitary_modifier (ns_right_command_modifier) : 0) \
| (([e modifierFlags] & NSCommandKeyMask) ? \
parse_solitary_modifier (ns_command_modifier):0))
@@ -4424,7 +4444,14 @@
if (flags & NSCommandKeyMask)
{
- emacs_event->modifiers |= parse_solitary_modifier
(ns_command_modifier);
+ if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask
+ && !EQ (ns_right_command_modifier, Qleft))
+ emacs_event->modifiers |= parse_solitary_modifier
+ (ns_right_command_modifier);
+ else
+ 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)
@@ -4458,8 +4485,15 @@
}
if (flags & NSControlKeyMask)
- emacs_event->modifiers |=
- parse_solitary_modifier (ns_control_modifier);
+ {
+ if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask
+ && !EQ (ns_right_control_modifier, Qleft))
+ emacs_event->modifiers |= parse_solitary_modifier
+ (ns_right_control_modifier);
+ else
+ emacs_event->modifiers |= parse_solitary_modifier
+ (ns_control_modifier);
+ }
if (flags & NS_FUNCTION_KEY_MASK && !fnKeysym)
emacs_event->modifiers |=
@@ -6246,11 +6280,27 @@
Set to control, meta, alt, super, or hyper means it is taken to be that key.");
ns_command_modifier = Qsuper;
+ DEFVAR_LISP ("ns-right-command-modifier", &ns_right_command_modifier,
+ "This variable describes the behavior of the right command
key.\n\
+Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
+Set to left means be the same key as `ns-command-modifier'.\n\
+Set to none means that the command / option key is not interpreted by Emacs\n\
+at all, allowing it to be used at a lower level for accented character
entry.");
+ ns_right_command_modifier = Qleft;
+
DEFVAR_LISP ("ns-control-modifier", &ns_control_modifier,
"This variable describes the behavior of the control key.\n\
Set to control, meta, alt, super, or hyper means it is taken to be that key.");
ns_control_modifier = Qcontrol;
+ DEFVAR_LISP ("ns-right-control-modifier", &ns_right_control_modifier,
+ "This variable describes the behavior of the right control
key.\n\
+Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
+Set to left means be the same key as `ns-control-modifier'.\n\
+Set to none means that the control / option key is not interpreted by Emacs\n\
+at all, allowing it to be used at a lower level for accented character
entry.");
+ ns_right_control_modifier = Qleft;
+
DEFVAR_LISP ("ns-function-modifier", &ns_function_modifier,
"This variable describes the behavior of the function key (on
laptops).\n\
Set to control, meta, alt, super, or hyper means it is taken to be that key.\n\
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r102462: Add separate key mappings for left/right control/command on Nextstep (Bug#7458).,
Jan D. <=