There are some subclasses with different behavior:
Selections made with the left mouse button are put into the X selection and can thus be pasted into another program. You can paste the X selection in by clicking the middle mouse button at the insertion point.
Emacs control keys are simulated:
Arrow keys | Move the insertion point. Up/down arrows only work in the Fl_Multiline_Input object, otherwise they navigate the the next/previous Fl_input object. Shift+arrow will extend the selection. |
Backspace | Deletes one character to the left, or deletes the selected region. |
Delete | Deletes one character to the right or deletes the selected region. To handle X servers that don't have backspace keys, this key is translated by Fl into Backspace unless a real backspace has been encountered. |
Return | May cause the callback, see when(). |
Home | Go to the start of line. |
End | Go to the end of line. |
^A | Go to start of line. |
^B | Move left |
^C | Copy the selection to the X selection |
^D | Delete one character to the right or deletes the selected region. |
^E | Go to the end of line. |
^F | Move right |
^K | Delete to the end of line (next \n character) or deletes a single \n character. These deletions are all concatenated into the X selection. |
^N | Move down |
^P | Move up |
^Q | Quote next character, lets you insert control or meta characters (use Alt to "metaize" a character). |
^U | Delete everything. |
^V or ^Y | Paste the X selection |
^X or ^W | Copy the region to the X selection and delete it. |
^Z or ^_ | Undo. This is a single-level undo mechanism, but all adjacent deletions and insertions are concatenated into a single "undo". Often this will undo a lot more than you expected. |
Fl_Input(int,int,int,int,const char * = 0);
const char *value() const;
int value(const char *);
char index(int) const;
int size() const;
uchar when() const;
void when(uchar);
FL_WHEN_RELEASE
:0
: The callback is not done, but changed() is
turned on.
FL_WHEN_CHANGED
: The callback is done each time the
text is changed by the user.
FL_WHEN_RELEASE
: The callback will
be done when this object loses the focus, including when the window is
unmapped. This is a useful value for text fields in a panel where
doing the callback on every change is wasteful. However the callback
will also happen if the mouse is moved out of the window, which means
it should not do anything visible (like pop up an error message). You
might do better setting this to zero, and scanning all the items for
changed() when the OK button on a panel is pressed.
FL_WHEN_ENTER_KEY
: If the user types the Enter key,
the entire text is selected, and the callback is done if the text has
changed. Normally the Enter key will navigate to the next field (or
insert a newline for a Fl_Mulitline_Input), this changes the behavior.
FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED
: The Enter key
will do the callback even if the text has not changed. Useful for
command fields.
int changed() const;
void set_changed();
void clear_changed();
uchar textfont() const;
void textfont(uchar);
uchar textsize() const;
void textsize(uchar);
uchar textcolor() const;
void textcolor(uchar);
uchar cursor_color() const;
void cursor_color(uchar);
uchar selection_color() const;
void selection_color(uchar);