Using Gnu Emacs in MacOS "El Capitan".
Question:
How do I bind the right option key to control but keep the left option key bound to option?
Background:
I found that even with caps_lock as control my left hand would start to ache, so I decided to have as many control keys as possible. Before switching to Mac I never used caps_lock or option (still don't use caps_lock), so I bound both of them to control: caps_lock to control in the Keyboard systems preferences and option to control in my .emacs file.
Unlike PC keyboards, the Apple keyboard has only one control key but two option keys (one on the outside of each of the two command keys):
But now I'm finding that I would like to be able to have an option key in Emacs. There is already a control key on the bottom left but not one on the bottom right, so ideally I would revert just the left option key (now mapped to control) back to option But I still want the right option key to be a control.
These are the relevant lines from my .emacs file.
(setq
mac-option-key-is-control t
mac-option-modifier 'control
)
(setq ns-right-alternate-modifier 'none)
and set thens-right-command-modifier
to whatever you want -- e.g.,'control
.mac-right-option-modifier
instead ofns-right-option-modifier
.