Skip to content

Commit

Permalink
Adding Fl_Input comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWM committed Aug 11, 2024
1 parent 48303cd commit 2013c4f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/Fl_Input.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2013c4f

Please sign in to comment.