website/ref/edit.md: Document that some keys may not be available from the terminal.

This commit is contained in:
Qi Xiao 2024-05-03 15:17:09 +01:00
parent 57078f79be
commit 2f9f2fa3e4

View File

@ -194,10 +194,30 @@ Bound functions have their inputs redirected to /dev/null.
### Format of Keys ### Format of Keys
Key modifiers and names are case sensitive. This includes single character key A key consists of a **key name**, preceded by zero or more **key modifiers**.
names such as `x` and `Y` as well as function key names such as `Enter`. Both are case-sensitive.
Key names have zero or more modifiers from the following symbols: The key name may be either:
- A simple character, such as `x`.
Most of the time you should use the lower-case form of letters, except for
Ctrl- bindings, which usually require the upper-case form (so `Alt-x` but
`Ctrl-X`). This quirk may go away in future.
- A function key from these symbols:
```
F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
Up Down Right Left
Home Insert Delete End PageUp PageDown
Tab Enter Backspace
```
Among these, `Tab` and `Enter` are equivalent to their ASCII counterparts
`"\t"` and `"\n"`.
Key modifiers are one of the following:
``` ```
A Alt A Alt
@ -206,26 +226,30 @@ M Meta
S Shift S Shift
``` ```
Modifiers end with either a `-` or `+`, such as in `S-F1`, `Ctrl-X` or Modifiers end with either a `-` or `+`, and can be stacked. Examples:
`Alt+Enter`. You can stack modifiers, such as in `C+A-X`.
The key name may be a simple character such as `x` or a function key from these - `S-F1`
symbols:
``` - `Ctrl-X` or
F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
Up Down Right Left
Home Insert Delete End PageUp PageDown
Tab Enter Backspace
```
**Note:** `Tab` is an alias for `"\t"` (aka `Ctrl-I`), `Enter` for `"\n"` (aka - `Alt+Enter`
`Ctrl-J`), and `Backspace` for `"\x7F"` (aka `Ctrl-?`).
- `C+A-X`.
**Note:** The `Shift` modifier is only applicable to function keys such as `F1`. **Note:** The `Shift` modifier is only applicable to function keys such as `F1`.
You cannot write `Shift-m` as a synonym for `M`. You cannot write `Shift-m` as a synonym for `M`.
**TODO:** Document the behavior of the `Shift` modifier. You may not actually be able to use the full range of possible keys for several
reasons:
- Some `Ctrl-[letter]` keys have special functions, like `Ctrl-C`, `Ctrl-Z`,
`Ctrl-S` and `Ctrl-Z`.
- Some `Ctrl-[letter]` keys are equivalent to single keypresses, like `Ctrl-J`
(equivalent to `Enter`) and `Ctrl-I` (equivalent to `Tab`).
- Keys involving multiple modifiers may not be supported by the terminal
emulator, especially when the base key is a function key.
### Listing Modes ### Listing Modes