Unfortunately you probably should not depend on any text being in the
keyup events. That is not compatible with any kind of input method.
If you are interested in the letter, the keysym is equal to it for ascii
at least.
On 06/02/2011 11:51 PM, Evan Laforge wrote:
> Some keys recently stopped working in my app and I tracked it down to
> what I believe is a new bug. This is OS X with the latest svn fltk
> 1.3.
>
> When a modifier is down, Fl::event_text() no longer emits anything.
> In fact it appears key ups no longer put anything in event_text() at
> all. The following program should reproduce it. I believe that
> previously keyup the letter (capital if shift is held), but now it
> doesn't.
>
> #include<FL/FL_Window.H>
> #include<FL/Fl_Box.H>
> #include<FL/Fl.H>
>
>
> class Box : public Fl_Box {
> public:
> Box(int x, int y, int w, int h) : Fl_Box(x, y, w, h) {}
> int handle(int evt) {
> if (evt == FL_KEYDOWN) {
> printf("keydown, text: %s, key: %c\n", Fl::event_text(),
> Fl::event_key());
> } else if (evt == FL_KEYUP) {
> printf("keyup, text: %s, key: %c\n", Fl::event_text(),
> Fl::event_key());
> }
> }
> };
>
> int
> main(int argc, char **argv)
> {
> Fl_Window win(0, 0, 200, 200);
> Box b(0, 0, 200, 200);
> win.show();
> Fl::run();
> return 0;
> }
>
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev