From b583a643deeaf0a21dac5ee5a2ae0f84f9648dad Mon Sep 17 00:00:00 2001
From: Bill Spitzak
For instance, to type "á" type [compose][a]['] or [compose]['][a].
+
+ The character "nbsp" (non-breaking space) is typed by using
+[compose][space].
+
+ 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][~].
+
+ The same key may be used to "quote" control characters into the
+text. If you need a ^Q character you can get one by typing
+[compose][Control+Q].
+
+ X may have a key on the keyboard
+defined as XK_Multi_key. If so this key may be used as well
+as the right-hand control key. You can set this up with the program
+xmodmap.
+
+ If your keyboard is set to support a foreign language you should
+also be able to type "dead key" prefix characters. On X you will
+actually be able to see what dead key you typed, and if you then move
+the cursor without completing the sequence the accent will remain
+inserted.
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.
+
-
-Mouse button 1 Moves the cursor to this point.
- Drag selects characters. Double click selects words. Triple click
-selects all text. Shift+click extends the selection.
+
+Mouse button 2 Insert the current X selection at
-the cursor (unlike Motif this does not move the insertion point to the
-mouse). If the widget does not have the input focus (and thus no
-cursor) it puts the cursor where clicked and inserts the selection
-there.
+
+Mouse button 1 Moves the cursor to
+ this point. Drag selects characters. Double click selects words.
+ Triple click selects all text. Shift+click extends the selection.
+ When you select text it is automatically copied to the clipboard.
+
+
Mouse button 2 Insert the clipboard at
+the point clicked. You can also select a region to replace with the
+clipboard by selecting a region with mouse button 2.
+
+
Mouse button 3 Currently acts like button 1. Backspace Deletes one character to the left, or
deletes the selected region.
@@ -44,9 +51,7 @@ deletes the selected region.
Enter May cause the callback, see when(). ^B or Left Move left ^C Copy the selection to the clipboard
+or deletes the selected region.
^D or Delete Deletes one character to the right
-or deletes the selected region. Due to silly historical X problems,
-the Delete key will act like Backspace until you type a "real"
-backspace. ^E or End Go to the end of line. ^F or Right Move right
only, otherwise it moves to the next input field).
^K Delete to the end of line (next \n character)
@@ -56,11 +61,6 @@ into the clipboard.
-^P or Up Move up (for Fl_Multiline_Input only,
otherwise it moves to the previous input field). ^Q or
-
RightCtrl or
-
ComposeStart a compose-character
- sequence. The next one or two keys typed define the character to
-insert. This also can be used to "quote" control characters. ^U Delete everything. ^V or ^Y Paste the clipboard ^X or ^W Copy the region to the clipboard and
@@ -71,6 +71,158 @@ into a single "undo". Often this will undo a lot more than you
expected.
+
+Shift+move Move the cursor but also extend the
selection. RightCtrl or
+
Compose
+Start a compose-character
+sequence. The next one or two keys typed define the character to insert:
+
+
+
+ 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 ÿ
+ Methods
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. -