From b583a643deeaf0a21dac5ee5a2ae0f84f9648dad Mon Sep 17 00:00:00 2001
From: Bill Spitzak To receive If you are writing a text-editing widget you may also want to call
+the Fl::compose() function to translate
+individual keystrokes into foreign characters.
+
FL_KEYBOARD events you must also respond to the
FL_FOCUS and FL_UNFOCUS events.
+FL_SHORTCUT
If the Fl::focus() widget is zero
or ignores an FL_KEYBOARD event then FLTK tries sending this
@@ -102,7 +106,8 @@ active_r() to check this).
This widget is now active, due to
activate() being called on it or one of its parents.
FL_HIDE
- This widget is no longer visible, due to
+href=Fl_Widget.html#Fl_Widget.show>
show() being called on it or one of its parents, or due to
a parent window being restored. Child Fl_Windows respond to
this by actually creating the window if not done already, so if you
@@ -128,7 +133,8 @@ Fl::event_length().
The Fl::selection_owner()
will get this event before the selection is moved to another widget.
This indicates that some other widget or program has claimed the
-selection.
+selection. Motif programs used this to clear the selection
+indication. Most modern programs ignore this.
Fl::event_*() methods
FLTK keeps the information about the most recent event in static
storage. This information is good until the next event is processed.
@@ -181,172 +187,45 @@ to leaf widgets. These procedures control those leaf widgets:
To insert them, type the [compose] key and then one or two -characters. The two characters can be in either order. The [compose] -key is any of: Ctrl+Q, the righthand control key, or any key your X server -calls XK_Multi_key. - -
| Keys | Char | - | Keys | Char | - | Keys | Char | - | Keys | Char | - | Keys | Char | - | Keys | Char - |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| space | nbsp | - | * | ° | - | A` | À | - | D- | Ð | - | a` | à | - | d- | ð - |
| ! | ¡ | - | +- | ± | - | A' | Á | - | N~ | Ñ | - | a' | á | - | n~ | ñ - |
| % | ¢ | - | 2 | ² | - | A^ | Â | - | O` | Ò | - | a^ | â | - | o` | ò - |
| # | £ | - | 3 | ³ | - | A~ | Ã | - | O' | Ó | - | a~ | ã | - | o' | ó - |
| $ | ¤ | - | ' | ´ | - | A: | Ä | - | O^ | Ô | - | a: | ä | - | o^ | ô - |
| y= | ¥ | - | u | µ | - | A* | Å | - | O~ | Õ | - | a* | å | - | o~ | õ - |
| | | ¦ | - | p | ¶ | - | AE | Æ | - | O: | Ö | - | ae | æ | - | o: | ö - |
| & | § | - | . | · | - | C, | Ç | - | x | × | - | c, | ç | - | -: | ÷ - |
| : | ¨ | - | , | ¸ | - | E` | È | - | O/ | Ø | - | e` | è | - | o/ | ø - |
| c | © | - | 1 | ¹ | - | E' | É | - | U` | Ù | - | e' | é | - | u` | ù - |
| a | ª | - | o | º | - | E^ | Ê | - | U' | Ú | - | e^ | ê | - | u' | ú - |
| << | « | - | >> | » | - | E: | Ë | - | U^ | Û | - | e: | ë | - | u^ | û - |
| ~ | ¬ | - | 14 | ¼ | - | I` | Ì | - | U: | Ü | - | i` | ì | - | u: | ü - |
| - | | - | 12 | ½ | - | I' | Í | - | Y' | Ý | - | i' | í | - | y' | ý - |
| r | ® | - | 34 | ¾ | - | I^ | Î | - | TH | Þ | - | i^ | î | - | th | þ - |
| _ | ¯ | - | ? | ¿ | - | I: | Ï | - | ss | ß | - | i: | ï | - | y: | ÿ - |
For instance, to type "á" type [compose][a]['] or [compose]['][a]. - -
The character "nbsp" (non-breaking space) is typed by using -[compose][space]. +The foreign-letter compose processing done by the Fl_Input widget is provided in +a function that you can call if you are writing your own text editor +widget. -
The single-character sequences may be followed by a space if -necessary to remove ambiguity. For instance, if you really want to -type "ª~" rather than "ã" you must type [compose][a][space][~]. +
Fltk uses it's own compose processing to allow "preview" of the +partially composed sequence, which is impossible with the usual +"dead key" processing. -
If you wish to use the compose function in your own code, your -widget's handle() method must call fl_compose() -in response to FL_KEYPRESS events: +
Although currently only characters in the ISO-8859-1 character set are +handled, you should call this in case any enhancements to the +processing are done in the future. The interface has been designed to +handle arbitrary UTF-8 encoded text. -
Use of this function is very simple. Any text editing widget should +call this for each FL_KEYBOARD event. -
state must either be the return value of the last call to -fl_compose() or zero to start a new compose sequence. Be sure to reset -to zero if the user ever moves the cursor. +
If true is returned, then it has modified the +Fl::event_text() and Fl::event_length() to a set of bytes to +insert (it may be of zero length!). In will also set the "del" +parameter to the number of bytes to the left of the cursor to +delete, this is used to delete the results of the previous call to +Fl::compose(). -
c is the ASCII character that the user typed. +
If false is returned, the keys should be treated as function +keys, and del is set to zero. You could insert the text anyways, if +you don't know what else to do. -
del is set to the number of bytes to delete backwards. This -will always be less or equal to the ins from the last call to -fl_compose(), and will be zero if state is zero. +
Though the current implementation returns immediately, future +versions may take quite awhile, as they may pop up a window or do +other user-interface things to allow characters to be selected. -
buffer will have the first ins bytes set to the data -to insert and display (it is not nul-terminated). +
ins will be the number of characters to insert. +
If the user moves the cursor, be sure to call Fl::compose_reset(). +The next call to Fl::compose() will start out in an initial state. In +particular it will not set "del" to non-zero. This call is very fast +so it is ok to call it many times and in many places. -