From b583a643deeaf0a21dac5ee5a2ae0f84f9648dad Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Mon, 21 Feb 2000 10:45:59 +0000 Subject: Forgot to commit the header files and fixed documentation! git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1008 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/events.html | 203 ++++++++++------------------------------------ 1 file changed, 41 insertions(+), 162 deletions(-) (limited to 'documentation/events.html') diff --git a/documentation/events.html b/documentation/events.html index 88ec9b9f3..502be762f 100644 --- a/documentation/events.html +++ b/documentation/events.html @@ -80,6 +80,10 @@ event.

To receive FL_KEYBOARD events you must also respond to the FL_FOCUS and FL_UNFOCUS events. +

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_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:

FLTK Compose-Character Sequences

-The Fl_Input widget lets you type all the -characters in the standard ISO-8859-1 character set. Most fonts will -display these characters correctly. - -

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. - -

- - - - - - - - - - - - - - - - - -
KeysChar - KeysChar - KeysChar - KeysChar - KeysChar - KeysChar -
spacenbsp - *° - 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. -

int fl_compose(int state, char c, int &del, char *buffer, int &ins)

+

int Fl::compose(int& del)

-Starts or adds a single ASCII character to a compose sequence. This -will return the number of old bytes to delete and a set of new bytes to -insert, and a new state value. If this returns zero you can -ignore the result (which just says to insert the character unchanged) -and handle the keystroke yourself. +

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). +

int Fl::compose_reset()

-

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. - + -- cgit v1.2.3