do_command(ch)
Process a single command keystroke. Here are the supported special keystrokes:
Keystroke | Action |
---|---|
Control-A | Go to left edge of window. |
Control-B | Cursor left, wrapping to previous line if appropriate. |
Control-D | Delete character under cursor. |
Control-E | Go to right edge (stripspaces off) or end of line (stripspaces on). |
Control-F | Cursor right, wrapping to next line when appropriate. |
Control-G | Terminate, returning the window contents. |
Control-H | Delete character backward. |
Control-J | Terminate if the window is 1 line, otherwise insert newline. |
Control-K | If line is blank, delete it, otherwise clear to end of line. |
Control-L | Refresh screen. |
Control-N | Cursor down; move down one line. |
Control-O | Insert a blank line at cursor location. |
Control-P | Cursor up; move up one line. |
Move operations do nothing if the cursor is at an edge where the movement is not possible. The following synonyms are supported where possible:
Constant | Keystroke |
---|---|
KEY_LEFT | Control-B |
KEY_RIGHT | Control-F |
KEY_UP | Control-P |
KEY_DOWN | Control-N |
KEY_BACKSPACE | Control-h |
All other keystrokes are treated as a command to insert the given character and move right (with line wrapping).
Please login to continue.