1. Hotkeys and Toolbars
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)?
Ray Tomes
2. Re: Hotkeys and Toolbars
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
3. Re: Hotkeys and Toolbars
Derek Parnell wrote:
> 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.
Derek, thanks for you assistance. Actually I want to use EUwinGUI
because I can understand that better.
Ray
4. Re: Hotkeys and Toolbars
On Mon, 16 Jun 2003 13:20:52 +1200, Ray Tomes <rtomes at ihug.co.nz> wrote:
>
>
> Derek Parnell wrote:
>
>> 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.
>
> Derek, thanks for you assistance. Actually I want to use EUwinGUI because
> I can understand that better.
No problems. Good luck with the project.
--
cheers,
Derek Parnell
5. Re: Hotkeys and Toolbars
Welcome Ray,
What part of Ting (Aku)'s system wide hot key program does what you want, &
what's left not handled? Maybe it could be modified.
BTW, many here (well, me) are more familiar with Win32Lib & Judith's IDE
than with Andrea's EUwinGUI.
Dan Moyer
----- Original Message -----
From: "Ray Tomes" <rtomes at ihug.co.nz>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, June 15, 2003 5:22 PM
Subject: Hotkeys and Toolbars
>
>
> 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)?
>
> Ray Tomes
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>
6. Re: Hotkeys and Toolbars
Dan Moyer wrote:
> What part of Ting (Aku)'s system wide hot key program does what you want, &
> what's left not handled? Maybe it could be modified.
Hi Dan
As far as I know it does all of what I want a hotkey routine to do.
The "part" in my post referred to the fact that I also had to work out
how to get the keystrokes without a DOS type window (now done) and how
to launch a program. It seems again (as with the keystrokes) that the
standard EU "system" and "system_exec" are no use for my purpose because
they wait for the job to complete which I don't want to do, I just want
to launch the job. But again there is another call to Win32Lib or
EUwinGUI that does this.
However I have some difficulty understanding the code in Ting's demo,
simple though it is. I tried to copy the relevant parts and leave out
the need for his 4 button window. What I wanted was when I launched my
hotkeytoolbar to always set a fixed hotkey (say F12) that will make a
program pop up. But when I copied the parts of the demo that I thought
were needed it didn't work. If this persists I will post my code.
Thanks again Dan
Ray
7. Re: Hotkeys and Toolbars
Ray,
If you *just* want to set a hot key, try this simple mod of Aku's code.
It takes out the buttons, leaves his include, leaves the event trap, moves
setting the hotkey outside any routine, and, makes the window open up
MINIMIZED, so you don't see it. Pressing the Window-F6 key should get get
you the test msg box.
If you instead want to be able to set what button & what action on the fly
instead of programmatically, then you'll have to put the buttons back in :)
& use them. Maybe an edit box to allow user input for the name of a program
to activate, and a bunch of elsif's (grin) & a list box to select from
various possible keys to make hot keys from.
Dan Moyer
--<CODE FOLLOWS:>
-- code generated by Win32Lib IDE v0.10.5
include Win32lib.ew
--.55
without warning
----------------------------------------------------------------------------
----
-- Window Window1
global constant Window1 = create( Window, "Ting - System-Wide Hot Key Demo",
0, Default, Default, 400, 300, 0 )
----------------------------------------------------------------------------
----
include hotkey.e
procedure Window1_onHotKey(atom id)
object x
x = message_box("HotKey id " & sprintf("%g", id) & " pressed", "HotKey
demo", MB_SETFOREGROUND)
end procedure
onHotKey = routine_id("Window1_onHotKey")
----------------------------------------------------------------------------
----
setHotKey(Window1, 2, MOD_WIN, VK_F6)
WinMain( Window1, Minimize )
--<CODE ENDS>
----- Original Message -----
From: "Ray Tomes" <rtomes at ihug.co.nz>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, June 16, 2003 4:35 PM
Subject: Re: Hotkeys and Toolbars
>
>
> Dan Moyer wrote:
>
> > What part of Ting (Aku)'s system wide hot key program does what you
want, &
> > what's left not handled? Maybe it could be modified.
>
> Hi Dan
>
> As far as I know it does all of what I want a hotkey routine to do.
>
> The "part" in my post referred to the fact that I also had to work out
> how to get the keystrokes without a DOS type window (now done) and how
> to launch a program. It seems again (as with the keystrokes) that the
> standard EU "system" and "system_exec" are no use for my purpose because
> they wait for the job to complete which I don't want to do, I just want
> to launch the job. But again there is another call to Win32Lib or
> EUwinGUI that does this.
>
> However I have some difficulty understanding the code in Ting's demo,
> simple though it is. I tried to copy the relevant parts and leave out
> the need for his 4 button window. What I wanted was when I launched my
> hotkeytoolbar to always set a fixed hotkey (say F12) that will make a
> program pop up. But when I copied the parts of the demo that I thought
> were needed it didn't work. If this persists I will post my code.
>
> Thanks again Dan
>
> Ray
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>
8. Re: Hotkeys and Toolbars
Dan Moyer wrote:
> If you *just* want to set a hot key, try this simple mod of Aku's code.
> It takes out the buttons, leaves his include, leaves the event trap, moves
> setting the hotkey outside any routine, and, makes the window open up
> MINIMIZED, so you don't see it. Pressing the Window-F6 key should get get
> you the test msg box.
Dan
I can definitely get to where I want to from here, many thanks.
Also, I got some code going to make a toolbar and launch programs from
it by either button press of keystroke, so I am going to finish the job.
Unfortunately, I have used EUwinGUI for that part while the hotkey part
wants Win32Lib, so I will convert to Win32Lib now that I have been
pointed to the documentation. :)
Might take me a few days to read it all though :) Gee! Have you guys
been busy or what, making all of this? I am very impressed, and, I am
not easily impressed. I am very definitely a Euphoria convert.
Wow!
Ray