Adding Fl_Input comments.

This commit is contained in:
Matthias Melcher 2024-08-11 12:11:35 +02:00
parent 48303cd295
commit 2013c4fd67

View File

@ -320,13 +320,30 @@ int Fl_Input::kf_copy_cut() {
class. It handles compose key sequences and can also be used e.g. in
Fl_Multiline_Input, Fl_Float_Input and several more derived classes.
The details are way too complicated to be documented here and can be
changed as required. If in doubt, please consult the source code.
The method first checks in Fl::compose if the keystroke is a text entry or
a control key. If it is text, the method inserts the composed characters into
the input field, taking into account the input type (e.g., numeric fields).
If the keystroke is a control key as determined by Fl::compose, the method
handles key combinations for Insert, Enter, and Tab depending on the
widget's input_type().
The method then checks for Ctrl key combinations, such as Ctrl-A, Ctrl-C,
Ctrl-V, Ctrl-X, and Ctrl-Z, which are commonly used for select all, copy,
paste, cut, and undo operations.
Finally, the method checks for ASCII control characters, such as Ctrl-H,
Ctrl-I, Ctrl-J, Ctrl-L, and Ctrl-M, which can be used to insert literal
control characters into the input field.
If none of the above cases match, the method returns 0, indicating that the
keystroke was not handled.
\returns 1 if the keystroke is handled by us, 0 if not.
*/
int Fl_Input::handle_key() {
// This is unicode safe: only character codes < 128 are queried
char ascii = Fl::event_text()[0];
int del;