Here's what I did to test this in Immed:
Sub blah(firstPress) : If firstPress Then : print "Do first action" :
Else : print "Do Second Action" : End If : End Sub
and then
Set myKey = Keyboard.RegisterHotkey("Control-Shift-5", "blah", , , True)
If I then press Control-Shift-5, I get back:
Do First Action
If I press it again, I get back:
Do Second Action
If I don't press any other key, and then press Control-Shift-5 again, I
get back:
Do Second Action
If I press some other key, and then press Control-Shift-5, I get back:
Do First Action
So that's one way to do it.
Aaron
martin webster wrote:
Hi all,
Can some body please help me with this. I need an example of a hotkey being
toggle. For example, when pressed once this routine will call a function, and
when press a second time the routine will call another function, and keep going
between the two functions when a specific hotkey is pressed simular to the
toggle punctuation script. I have tried to annalize this script, but there is
no real documentation for the GWTool kit which this script seems to use. All
so, where is the wiki to be found.
Warm regards.
Martin Webster.
--
To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.
Aaron Smith
GW Micro
Phone: 260/489-3671
Fax: 260/489-2608
WWW: http://www.gwmicro.com
FTP: ftp://ftp.gwmicro.com
Technical Support & Web Development