> #include <FL/Fl.H> > #include <FL/Fl_Window.H> > #include <FL/Fl_Secret_Input.H> > #include <iostream> > > class myWindow : public Fl_Window { > public: > myWindow(int x, int y, const char* l) : Fl_Window(x, y, l) { } > > virtual int handle(int event) { if (event== FL_SHORTCUT) { > static int n = 0; > if (Fl::event_state() & FL_CAPS_LOCK) { > std::cout << "caps lock" << " " << ++n << std::endl; > } else { > std::cout << "caps unlock" << " " << ++n << std::endl; > } return 1; } else > return Fl_Window::handle(event); > } > }; > > int main(int argc, char* argv[]) { > myWindow* win = new myWindow(300, 200, ""); > new Fl_SecretInput(20, 20, 100, 15, ""); > > win->end(); > win->show(); > > return Fl::run(); > }
_______________________________________________ fltk mailing list fltk@easysw.com http://lists.easysw.com/mailman/listinfo/fltk