Re: Hotkeys and Toolbars
- Posted by Derek Parnell <ddparnell at bigpond.com> Jun 16, 2003
- 409 views
On Mon, 16 Jun 2003 12:22:38 +1200, Ray Tomes <rtomes at ihug.co.nz> wrote: > > > Hi All > > I would like to make a little toolbar that pops up whenever I hit a > hotkey, and then allows either a keystroke (or two) to be used or a > button push and allows me to do simple common tasks such as launch my > favourite programs. That way I can get rid of all my desk top icons with > their ctrl-alt-sequences for launching things and have an almost empty > desktop so that I boot faster (important on Win-Me as you have to boot > rather frequently). > > I am doing this partly as an exercise in learning Euphoria and partly > because I want the tool. Requirements of my HotKeyToolBar are: > > 1. The program should disappear most of the time. > > 2. The hotkey should work no matter what window I have up. > > 3. A little toolbar should appear and allow either mouse button press or > keystroke input (usually 1 but maybe 2 keystrokes). > > 4. The keystroke will determine an action such as launch a windows > program (not necessarily Eu). > > 5. The toolbar should then vanish again but still remain active. > > 6. There should be an easy option to reprogram some of the functions > temporarily to launch some applications that are being used a lot. > > Any hints about doing this are welcome. > > I have found Ting's system wide hotkey which does part of what I want. > However I have some difficulty because of my lack of GUI jargon > comprehension (see previous post). > > When I tried to get keystrokes I ended up with a big window popping up > which I didn't want, so I figure that wait_key is not the right way to do > this in GUI. How do I get a keystroke without a box for it assuming my > toolbar is selected)? Yes, wait_key() is not for GUI use. You need to trap the keystroke message from Windows. If you are using win32lib, this is done by setting a handler routine for the w32HKeyDown event. eg. procedure onKeyDown_toolbar(integer self, integer event, sequence parms) integer theKey integer theShifts theKey = parms[1] theShifts = parms[2] -- React to the keystroke. if theKey = VK_... then . . . closeWindow(launchwindow) end if end procedure setHander(mytoolbar, w32HKeyDown, routine_id("onKeyDown_toolbar")) -- cheers, Derek Parnell