Emacs Keys: Super Hyper

By Xah Lee. Date: . Last updated: .

What is Super Key, Hyper Key

Emacs supports extra modifier keys called Super and Hyper. These keys are historically on Lisp Machine Keyboards ⌨ .

symbolics keyboard pn 365407 rev A f950b
Symbolics keyboard pn 365407 rev A [image source https://deskthority.net/keyboards-f2/the-lisp-keyboards-t98.html, by webwit]

You can make any of ❖ Window or ▤ Menu or ⌥ option do Hyper or Super .

Why Use Super and Hyper?

The advantage of creating the Super and Hyper in emacs is that you can have more hotkeys, and no major or minor modes collide on your keys.

For example, Super for all your personal hotkeys, or for entering math symbols.

💡 TIP: if you have extra keys on your keyboard, i recommend not to use them for modifier combinations. Instead, use them as leader keys to create key sequences. That way, it's easier to press, and you get far more possible keybindings.

Create Super and Hyper Keys on Microsoft Windows

;; make PC keyboard's Win key or other to type Super or Hyper, for emacs running on Windows.
(setq w32-pass-lwindow-to-system nil)
(setq w32-lwindow-modifier 'super) ; Left Windows key

(setq w32-pass-rwindow-to-system nil)
(setq w32-rwindow-modifier 'super) ; Right Windows key

(setq w32-pass-apps-to-system nil)
(setq w32-apps-modifier 'hyper) ; Menu key

Windows Keyboard (Emacs Manual)

🛑 WARNING: in Microsoft Windows, several keybindings with the Windows key is bound at a low level, and applications do not see them. e.g. ❖ Window+L.

Create Super and Hyper Keys on MacOS

;; set keys for Apple keyboard, for emacs in OS X
(setq mac-command-modifier 'meta) ; make cmd key do Meta
(setq mac-option-modifier 'super) ; make opt key do Super
(setq mac-control-modifier 'control) ; make Control key do Control
(setq ns-function-modifier 'hyper)  ; make Fn key do Hyper

🛑 WARNING: if you set ⌘ command or Fn key, some of their Mac function remains. For example, ⌘ command+Tab still do switch app, and Fn key can still be used as the modifier for multimedia keys. Thanks to jcs, see [A Hyper Key for the Mac By Jon Snader. At http://irreal.org/blog/?p=1450 , accessed on 2013-04-21 ]

Create Super and Hyper Keys on Linux

By default, the ❖ Window key is Super.

On Linux, you define Super and Hyper key in the OS. For example, in Ubuntu 11.04, it's under menu [System ▸ Preferences ▸ keyboard] then “Layout” tap, “Options…” button.

Note that some Linux predefines some Super key. You need to take them off before emacs can see it. Best way to check is simply try define the key in emacs first and see if it works.

Super Hyper Keybinding Syntax

;; examples of keybinding with hyper or super key

;; H is for hyper
(global-set-key (kbd "H-b") #'left-char)

;; lower case “s” is for super
(global-set-key (kbd "s-b") #'left-char)

;; Hyper+Meta+b
(global-set-key (kbd "H-M-b") #'left-char)

;; Meta+Super+b
(global-set-key (kbd "M-s-b") #'left-char)

🛑 WARNING: Key Ghosting

Be aware that most keyboards won't be able to detect certain combination of keys. This is called “n-key rollover”.

For example, on Microsoft Natural Ergonomic 4000 keyboard, the key ▤ Menu+RShift+x does not register (but with left Shift it does). So, if you have set ▤ Menu to do Hyper, then Hyper+RShift+X won't work.

Vast majority of keyboards have ghosting problem, including Apple keyboards. For detail, see: What is NKRO, N-key Rollover? .