Unsatisfactory Workaround
The sequence C-x @ s-…
is equivalent to s-…
, e.g. C-x @ s-t
is equivalent to s-t
. Combined with iTerm2 shortcuts:
- Create a global or profile shortcut for
⌘…
set toSend hex code
, e.g.⌘t => Send hex code
Specify hex code of the form:
0x18 0x40 MOD KEY
whereMOD
is either0x68
or0x73
forh
ands
respectively andKEY
is the key you want modified withhyper
orsuper
. E.g. mapping⌘t
tos-t
:⌘t => 0x18 0x40 0x73 0x74
Repeat for every shortcut you want…meh…
Failed Experiment #1
In iTerm:
- Globally configure Left & Right Option keys as Left Option
- Globally configure Left & Right Command keys as Right Option
- In a profile, configure Left Option as
+ESC
and Right Option asMeta
Remapping ⌘
this way effectively disables all iTerm keyboard shortcuts…meh…
In Emacs:
Using Right Option (R⌥
) results in characters with 8th bit set, which as I understand it, is the old way of representing the META key press (back when keyboards had an actual META key).
However, I've failed to get Emacs to do something useful with this distinction. Given that META-t
=> t
with its 8th bit on => octal 364
I've tried:
(global-set-key (kbd "[R⌥-t]") (lambda () (interactive) (message "woot #1"))) (global-set-key (kbd "\364") (lambda () (interactive) (message "woot #2")))
Where [R⌥-t]
is the individual character that shows up in my buffer when I press that key sequence, represented graphically as \364
but behaving as a single character.
Worth noting that with our without the key binding, whenever I press R⌥-t
nothing is displayed in emacs until I press another key upon which emacs displays the \364
character followed by interpreting the second keypress. For instance, R⌥-t a
=> \364a<point>
and R⌥-t LEFT
=> <point>\364
, but only after a
or left arrow has been pressed.
You can experiment by only doing Step 3 above and using R⌥
directly.