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 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][~].

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:

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

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.

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.

c

Is the ASCII character that the user typed.

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.

buffer

Will have the first ins bytes set to the data to insert and display (it is not nul-terminated).

ins

ins will be the number of characters to insert.