2 * $Logfile: /Freespace2/code/UI/KEYTRAP.cpp $
7 * Routines for gadgets that trap keypresses.
10 * Revision 1.2 2002/05/07 03:16:53 theoddone33
11 * The Great Newline Fix
13 * Revision 1.1.1.1 2002/05/03 03:28:11 root
17 * 2 10/07/98 10:54a Dave
20 * 1 10/07/98 10:51a Dave
22 * 2 1/14/98 6:43p Hoffoss
23 * Massive changes to UI code. A lot cleaner and better now. Did all
24 * this to get the new UI_DOT_SLIDER to work properly, which the old code
25 * wasn't flexible enough to handle.
27 * 1 11/14/96 6:55p John
36 void UI_KEYTRAP::create(UI_WINDOW *wnd, int key, void (*_user_function)(void) )
38 base_create( wnd, UI_KIND_BUTTON, 0, 0, 0, 0 );
42 set_callback(_user_function);
44 parent = this; // Ugly. This keeps KEYTRAPS from getting keyboard control.
47 void UI_KEYTRAP::draw()
51 void UI_KEYTRAP::process(int focus)
59 if (my_wnd->keypress == hotkey) {
61 my_wnd->last_keypress = 0;
64 if (pressed_down && user_function) {
69 int UI_KEYTRAP::pressed()