diff options
| author | Matthias Melcher <github@matthiasm.com> | 2024-08-11 12:11:35 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2024-08-11 12:11:35 +0200 |
| commit | 2013c4fd67c5f4f6bf7d3082a47272d6a5ad5acc (patch) | |
| tree | 248ced1d7830d74f8484db9460d04049ec5d8263 /src | |
| parent | 48303cd295e55d3fb51d7f4cbe534e1d6db305b3 (diff) | |
Adding Fl_Input comments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Input.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 948354d19..a079f8f5a 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -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; |
