2 * $Logfile: /Freespace2/code/UI/KEYTRAP.cpp $
7 * Routines for gadgets that trap keypresses.
10 * Revision 1.1 2002/05/03 03:28:11 root
14 * 2 10/07/98 10:54a Dave
17 * 1 10/07/98 10:51a Dave
19 * 2 1/14/98 6:43p Hoffoss
20 * Massive changes to UI code. A lot cleaner and better now. Did all
21 * this to get the new UI_DOT_SLIDER to work properly, which the old code
22 * wasn't flexible enough to handle.
24 * 1 11/14/96 6:55p John
33 void UI_KEYTRAP::create(UI_WINDOW *wnd, int key, void (*_user_function)(void) )
35 base_create( wnd, UI_KIND_BUTTON, 0, 0, 0, 0 );
39 set_callback(_user_function);
41 parent = this; // Ugly. This keeps KEYTRAPS from getting keyboard control.
44 void UI_KEYTRAP::draw()
48 void UI_KEYTRAP::process(int focus)
56 if (my_wnd->keypress == hotkey) {
58 my_wnd->last_keypress = 0;
61 if (pressed_down && user_function) {
66 int UI_KEYTRAP::pressed()