This approach will not do the modifier key in the sense that you press another key while holding the modifier, but nevertheless it allows you to use hyperlinks.
By default, you can use additional modifier keys using the Cx @ prefix. See Cx @ Ch for a complete list.
These bindings are in function-key-map
, and you can use the same method to get your own OS-independent bindings. eg:.
(define-key function-key-map (kbd "Cc H") 'event-apply-hyper-modifier)
function-key-map
is the parent for all instances of local-function-key-map
. Note:
Entries in the `local-function-key-map 'are ignored if they conflict with bindings made in small mode, local or global schedule. That is, reassignment is applied only if the original key sequence did not have a binding.
Ch i g (elisp) Translation Keymaps
RET
Therefore, make sure that you are using a key sequence without existing bindings. (Theoretically, this is pretty restrictive, but YMMV.)
Edit:. To clarify, this gives you the opportunity to access any existing hyper-bindings when using a machine without a hyper-modifier key, but does not actually create a new modifier key. If you do not have existing access bindings, this method has no advantages over regular prefix bindings.
I believe that, as Peter noted, creating a genuine modifier key is an OS level task. AFAIK, when you press a modifier key yourself, Emacs does not receive any input, and when you press a non-modifier with a modifier, Emacs receives an (modified) input. Conversely, when you press / hold a key without a modifier, Emacs immediately receives an input and cannot combine this input with any other input and consider everything as one (changed) event.
IIRC, xmodmap
will be a typical mechanism for achieving this on Unix systems, so this may be good for OSX. The following links may help: