#[non_exhaustive]pub enum Modifier {
Shift = 1,
Option = 2,
Control = 4,
Command = 8,
Extra1 = 16,
Extra2 = 32,
CapsLock = 64,
NumLock = 128,
Keypad = 256,
}
Expand description
A logical modifier of keys and mouse button presses.
This enumeration abstracts over the concrete modifier key, which may be on the left or right side of the keyboard, and instead includes variants for the logical modifier only. Contemporary keyboard generally include the following modifier keys:
- shift
- alt oroption
- control
- Windows, Linux, or command
- caps lock
- possibly num lock
Influential past keyboards, such as the space-cadet keyboard, further included the super, hyper, and meta modifiers.
Terminal emulators usually agree only on the names of the first three modifiers, (1) shift, (2) alt/option, and (3) control. Amongst further modifiers, xterm labels the fourth one meta, whereas kitty calls that modifier super and the sixth modifier meta. Given these divergent names, prettytty uses a neutral term, command, for the fourth modifier.
The Modifier::Keypad
variant is a virtual modifier, i.e., it has no
physical key. It is used to distinguish keys, such as / or
=, that appear even on a 60% or 65% keyboard from equally
labelled keys abutting the numeric pad, which only appears on 96% or 100%
keyboards.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Shift = 1
The shift key.
Option = 2
The alt or option key.
Control = 4
The control key.
Command = 8
The Windows, Linux, or command key. Xterm labels this modifier as meta and Kitty labels it as super
Extra1 = 16
A first extra modifier, labelled hyper by Kitty.
Extra2 = 32
A second extra modifier, labelled meta by Kitty.
CapsLock = 64
The caps lock key.
NumLock = 128
The number lock key.
Keypad = 256
A virtual modifier indicating a keypad key.