Pasting

Description
Pasting refers to inserting text into the display from the system's copy/paste buffer or clipboard in x3270, wc3270 and wx3270. (c3270, when used on a terminal emulator application rather than a real serial terminal, can also have text pasted into it, but c3270 is unaware that the pasted text is different from any other keyboard input and cannot apply these rules.)

Basic rules
Control characters are handled as follows:
 * Backspace (U+0008)
 * Interpreted as the Left action.


 * Tab (U+0009)
 * Intepreted as the Tab action.


 * Line feed (U+000a)
 * If overlayPaste or marginedPaste are true, moves to the left margin of the next row. Otherwise, interpreted as the Newline action.


 * Form feed (U+000c)
 * Translated to a space (U+0020).


 * Carriage return (U+000d)
 * Ignored.

Other control characters are ignored.

Ordinary text characters are entered as if they were typed at the keyboard. However, pasting differs from keyboard input in how the cursor moves after the text character is entered.

Margined paste
If overlayPaste or marginedPaste is true, then when the cursor wraps at the last column, it will move to the left margin: the column where the cursor was when the paste operation began. This allows input to be pasted into forms where the input fields line up vertically (such as many mainframe editors), but are not at the left edge of the screen.

Overlay paste
If the cursor moves off the end of an input field, the behavior depends on the overlayPaste resource. If overlayPaste is false, the cursor moves to the beginning of the next input field. If overlayPaste is true, the cursor simply moves to the Start Field character. Subsequent pasted characters are then ignored (other than moving the cursor to the right) if the cursor is on a read-only location.

Thus it is possible to copy a rectangular region of text from the screen, including read-only fields, and successfully paste that text into a screen that has the same formatting (the same arrangement of read-only and modifiable fields).