In the code below. The keypad number 5 requires the addition of the char (in single qoutes) of the number to FL_KP but for the F5 key it requires an integer. This doesn't seem consistent. The 1.3.5 docs under Enumerations specify adding an int not a char. So is this a bug or a typo in the docs? See the test code below. BTW I know a char is interpreted as an int for addition but '5' != 5
int main() {
Fl_Window *window = new Fl_Window(200,200,300,300);
Fl_Button *b = new Fl_Button(0, 0, 130, 40,"keypad 5");
b->callback(foo);
b->shortcut(FL_KP+5); //does not work
//b->shortcut(FL_KP+'5'); //works when adding char //b->shortcut(FL_F+5); // works when adding an int
//b->shortcut(FL_F+'5'); //does not work window->end();
window->show();
return Fl::run();
}
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.