home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
programs
/
desktop
/
newbar
/
Source
/
NewBar
/
c
/
hotkeys
< prev
next >
Wrap
Text File
|
1998-08-02
|
2KB
|
55 lines
/* hotkeys.c */
#include "OS:wimp.h"
#include "OS:wimpspriteop.h"
wimp_w hotkeys_window = 0;
/* To grab keys such as Shift-F12 we have to open a window with the `hot
keys' bit set, only somewhere we won't see it (such as behind the backdrop
window). We could set the `hot keys' bit on our iconbar window, but this
is more re-usable. We might, for example, want to hide the iconbar and
re-open it with a keypress. */
/* Hmm, for some reason this isn't working. Don't worry, not essential! */
void hotkeys_initialise(void)
{
#if 0
wimp_window w;
wimp_window_state state;
if(hotkeys_window) return;
/* Make sure it's off-screen and hidden */
w.visible.x0 = w.visible.y0 = 300;
w.visible.x1 = w.visible.y1 = 500;
w.xscroll = w.yscroll = 0;
w.next = wimp_TOP;
/* These are the flags that are vaguely important */
w.flags = wimp_WINDOW_AUTO_REDRAW || wimp_WINDOW_NO_BOUNDS ||
wimp_WINDOW_BACK || wimp_WINDOW_HOT_KEYS || wimp_WINDOW_NEW_FORMAT;
/* These don't matter, but zero them just in case */
w.title_fg = w.title_bg = w.work_fg = w.work_bg =
w.scroll_outer = w.scroll_inner = w.highlight_bg = w.reserved = 0;
w.extent.x0 = w.extent.y0 = 0;
w.extent.x1 = w.extent.y1 = 1000;
w.title_flags = 0;
w.work_flags = 0;
w.sprite_area = wimpspriteop_AREA;
w.xmin = w.ymin = 0;
w.title_data.text[0] = 0;
w.icon_count = 0;
/* Create the window */
hotkeys_window = wimp_create_window(&w);
/* And open the window, only hidden */
state.w = hotkeys_window;
wimp_get_window_state(&state);
state.next = wimp_HIDDEN;
wimp_open_window((wimp_open *) &state);
#endif
}