mirror of
https://github.com/fltk/fltk.git
synced 2026-06-02 15:46:52 +08:00
Adding Fl_Input comments.
This commit is contained in:
+19
-2
@@ -320,13 +320,30 @@ int Fl_Input::kf_copy_cut() {
|
|||||||
class. It handles compose key sequences and can also be used e.g. in
|
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.
|
Fl_Multiline_Input, Fl_Float_Input and several more derived classes.
|
||||||
|
|
||||||
The details are way too complicated to be documented here and can be
|
The method first checks in Fl::compose if the keystroke is a text entry or
|
||||||
changed as required. If in doubt, please consult the source code.
|
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.
|
\returns 1 if the keystroke is handled by us, 0 if not.
|
||||||
*/
|
*/
|
||||||
int Fl_Input::handle_key() {
|
int Fl_Input::handle_key() {
|
||||||
|
|
||||||
|
// This is unicode safe: only character codes < 128 are queried
|
||||||
char ascii = Fl::event_text()[0];
|
char ascii = Fl::event_text()[0];
|
||||||
|
|
||||||
int del;
|
int del;
|
||||||
|
|||||||
Reference in New Issue
Block a user