Re: Hotkeys and Toolbars

new topic     » goto parent     » topic index » view thread      » older message » newer message

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!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu