What is the correct way to handle letter input on FL_KEYBOARD event?

Using FLTK 1.1.9 (X11) event_text() gives me UTF-8 encoded text.
Is this always the case?, can I count on it being UTF-8 on all platforms?

Character conversion is not a problem as long as I know what to expect.

My scenario:

1- I want special handling of some function keys (FL_Tab etc..) this works fine 
via Fl::event_key().

2- "Ordinary" letters should be send somewhere (composed and with correct case.)

How can I achieve 2?  event_key() gives me keyboard button codes (where most 
happens to map as 8859-1), Since these are keycodes they miss shift-symbols and 
casing etc). event_text() gives me UTF-8 encoded text but correct symbols and 
case.

Did I understand the documentation below correctly that event_text() can be 
used for keyboard events?

http://www.fltk.org/documentation.php/doc-1.1/Fl.html#Fl.event_text says:
  Returns the text associated with the current FL_PASTE or FL_DND_RELEASE event.

however http://www.fltk.org/documentation.php/doc-1.1/events.html says:
  The text that the key should insert can be found with Fl::event_text() and 
its length is in Fl::event_length()

Thanks in advance,
 //Jakob
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to