> >>> 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. =A0The following program should reproduce it. =A0I believe that
> >>> previously keyup the letter (capital if shift is held), but now it
> >>> doesn't.
> >>
> >> Should be fixed with r.8773. Can you confirm, please?
> >
> > Looks good to me. =A0Thanks!
>
> Sorry, I spoke too soon!  If you hold down shift+control (or any other
> modifier), no text is emitted.
>
> However, maybe this is actually correct.  Control+letter doesn't
> actually emit that letter, so why should control+shift+letter?  My
> code to determine the letter is:
>
>     m.key =3D Fl::event_text()[0];
>     if (!isprint(m.key)) {
>         // shift or backspace or some such
>         m.key =3D Fl::event_key();
>     }
>     if (isletter(m.key) && FL_SHIFT in Fl::modifier_state())
>         m.key =3D toupper(m.key);
>
> This seems to get what I want.  In fact, I arguably shouldn't be using
> event_text()[0] at all, but I recall event_key() had some weird issues
> with my remapped keyboard.

This is what you get at key up after pressing A, shift-A, ctrl-A,
ctrl-shift-A, or cmd-A (on Mac OS):
Fl::event_length() is always 1
Fl::event_key() is always 'a', that is, the unmodified key
Fl::event_text()[0] is \01 for the 2 combinations with ctrl, 'A'
for shift-A, and 'a' for the other 2 combinations.
It matches what is documented for these functions.

_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to