2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/UI/KEYTRAP.cpp $
15 * Routines for gadgets that trap keypresses.
18 * Revision 1.3 2002/06/09 04:41:29 relnev
19 * added copyright header
21 * Revision 1.2 2002/05/07 03:16:53 theoddone33
22 * The Great Newline Fix
24 * Revision 1.1.1.1 2002/05/03 03:28:11 root
28 * 2 10/07/98 10:54a Dave
31 * 1 10/07/98 10:51a Dave
33 * 2 1/14/98 6:43p Hoffoss
34 * Massive changes to UI code. A lot cleaner and better now. Did all
35 * this to get the new UI_DOT_SLIDER to work properly, which the old code
36 * wasn't flexible enough to handle.
38 * 1 11/14/96 6:55p John
47 void UI_KEYTRAP::create(UI_WINDOW *wnd, int key, void (*_user_function)(void) )
49 base_create( wnd, UI_KIND_BUTTON, 0, 0, 0, 0 );
53 set_callback(_user_function);
55 parent = this; // Ugly. This keeps KEYTRAPS from getting keyboard control.
58 void UI_KEYTRAP::draw()
62 void UI_KEYTRAP::process(int focus)
70 if (my_wnd->keypress == hotkey) {
72 my_wnd->last_keypress = 0;
75 if (pressed_down && user_function) {
80 int UI_KEYTRAP::pressed()