next up previous contents index
Next: Hypertext Up: Prompt Line Previous: Prompt Line   Contents   Index

Prompt Line Editing

Some commands will convert the prompt line to editing mode. In this mode, the background color changes, and text typed by the user will appear in the prompt line window. Keys pressed when the main window has focus are directed to the prompt line.

When editing, the behavior is slightly different depending on whether the mouse pointer is over the prompt line area, or not. This is (or should be) true whether or not the window manager is click-to-focus or focus-follows-mouse. When the mouse pointer is over the prompt line, which gives the prompt line complete focus, the prompt line background color may be different from when the pointer is elsewhere. When the pointer is elsewhere, but the main window has focus, key presses are still sent to the prompt line, but there are a few keys, such as the arrow keys, which will operate on the drawing window rather than the prompt line.

When prompt line editing starts, the mouse pointer is ``warped'' to the left edge of the prompt line, providing full focus automatically. With the mouse pointer over the prompt line:

  1. The Numeric Keypad + and Numeric Keypad - keys will send a normal + or - character and not zoom the drawing window display.

  2. The arrow keys will move the prompt line text cursor, or perform some other operation specifically for text editing, depending on the command. These will not pan the display.

With the mouse pointer not over the prompt line, the keys mentioned will have their normal zoom and pan functionality. In text edit mode, key bindings from the table below are available, provisionally for the arrow keys as explained.

Prompt Line Editor Bindings
Ctrl-a Move cursor to beginning of line
Ctrl-e Move cursor to end of line
Ctrl-k Delete to end of line
Ctrl-p Paste primary selection at cursor
Ctrl-u Delete current line
Ctrl-v Paste clipboard at cursor
Left Move cursor left one character
Right Move cursor right one character
Page Down Move cursor to right by half a line, scroll if necessary
Page Up Move cursor to left by half a line, scroll if necessary
Backspace Delete previous character
Delete Delete next character
Esc Exit editing, abort operation
Enter Terminate editing

The Backspace key deletes the character or hypertext reference to the left of the cursor and moves the cursor to the left, and Delete deletes the object at the cursor. Ctrl-u deletes the entire line. Ctrl-k will delete the character at the cursor and all characters to the right. Ctrl-a and Ctrl-e move the cursor to the beginning or end of the line, respectively. The line will scroll to the left or right if longer that the available space, when the cursor hits the left and right boundaries. The Esc key exits edit mode, discarding the input. The Enter key exits edit mode, saving the input. The cursor can be at any position when Enter is pressed.

Double-clicking with button 1 in the prompt line area will effectively send an Enter character, terminating editing. Note that a double click requires two rapid clicks, if too slow two single-click events will occur.

Special characters can be entered using the Unicode escape Ctrl-u. The sequence starts by pressing Ctrl-u, then entering hex digits representing the character code, and is terminated with a space character or Enter. The Unicode coding can be obtained from tables provided on the internet, or from applications such as KCharSelect which is part of the KDE desktop. These are generally expressed as ``U + xxxx'' where the xxxx is a hex number. It is the hex number that should be entered following Ctrl-u. For example, the code for $ \pi$ (pi) is 03c0. Note that special characters can also be selected and copied, or in some cases dragged and dropped, from another window.

There is no limit on the number of characters in the string, which can be much longer than the display space. The Page Down and Page Up keys move the cursor to the right or left (respectively) by half the number of characters displayable in the prompt area, and will scroll if necessary to keep the cursor visible.

The Ctrl-p and Ctrl-v keys paste text from the primary selection and clipboard, respectively, at the cursor. Under Windows, these actions are identical, text is obtained from the Windows clipboard. Under Unix/Linux, clicking with button 2 will also paste the primary selection, and button 3 will also paste the clipboard. The primary selection is generally the most recently selected text in any window, the clipboard contains text that was explicitly saved via an operation in a text entry window.

While in editing mode, the keypress display to the left of the prompt line is replaced with two or three buttons. The R and S buttons, which are always present when the prompt line is in editing mode, provide access to five general-purpose registers for text, plus a register for the ``last'' text. Both buttons produce a drop-down menu containing register numbers. If a selection in made in the S menu, the text currently in the prompt area is saved to the register whose number was selected. Any previous content is overwritten. If a selection is made in the R menu, text saved in the register whose number is selected will replace the text in the prompt area. The saved text can contain hypertext entries (see below).

In some contexts, a third (``L'') button appears. This provides access to the ``long text'' capability, which allows multiple lines of text to be entered by providing access to a text editor window.

When editing mode is exited, the buttons disappear and are replaced with the keys pressed display. If Enter was pressed to terminate editing mode, the text is automatically saved in register 0, and will be available from the R menu the next time editing mode is entered.

For some property strings, if a line of text that is longer than 256 characters is opened for editing on the prompt line, the Text Editor will appear, loaded with the text. The text will be saved as a ``long text'' item.

These features are described in more detail in the description of the label command in 7.9.

Non-printing characters in the text will be displayed using special symbols, which can be edited (in edit mode) as normal characters. The non-printing character most likely to appear (and the only one that probably should appear) corresponds to the line termination character. These cause a line break when the text is displayed as a label on-screen, and can be entered while in editing mode with Shift-Enter. In Windows, these are shown as a paragraph symbol, while in Unix/Linux a ``v/t'' (vertical tab) glyph is used. Other characters will show as a black dot in Windows, or a ``strange'' character in Unix/Linux.

The prompt line participates in the drop protocol for files. Files dropped on the prompt line in normal mode have the same effect as files dropped in the main drawing window - the file will be taken as layout input and displayed in the drawing window.

When in text editing mode, files dropped in a drawing window or the prompt line will not be displayed, rather the full path to the file is inserted into the text line at the cursor. This means that when responding to a prompt to open a file, the File Selection pop-up from the File Select button in the File Menu can be used to find the file. The file can then be dragged into the main window or the prompt line window and dropped, and the name will appear on the prompt line. Also while the prompt line is in editing mode, pressing the Open (green octagon) button or the Open menu entry of the File Selection pop-up will load the selected file path into the prompt line rather than opening the cell for editing. In most situations where Xic prompts for a file path via the prompt line, a simplified version of the File Selection pop-up will appear while editing is active.

next up previous contents index
Next: Hypertext Up: Prompt Line Previous: Prompt Line   Contents   Index
Stephen R. Whiteley 2022-05-28