Vic,
If you want to use the array approach from the WE Script Framework, the
quickest way i can think of to accomplish what you want is to create a
parallel array of booleans whose values correspond to keys in the hot
key array. In the loop that registers the hot key, check the second
array. If true, call the RegisterHotKey routine that includes
ClientInformation.ApplicationProcess. Otherwise, call the original method.
Steve
On 6/22/2011 4:23 PM, Vic Beckley wrote:
Steve,
Thanks. I think I was modifying the wrong place. So this will make all hot
keys application specific, right? What if I want some that are and some that
are not? How can that be done?
Thanks for your quick help.
Vic
-----Original Message-----
From: Stephen Clower [mailto:[email protected]]
Sent: Wednesday, June 22, 2011 4:13 PM
To: [email protected]
Subject: Re: Advanced hot key topics
Hi Vic,
In this case, you should modify the line that registers the actual hot
keys in the array. Do a search for Keyboard.RegisterHotKey, and you
should come across a line that looks like this:
Set registeredHotkeys(iniKeyID) =
Keyboard.RegisterHotkey(SO_HotkeyManager.Key(iniKeyID),
SO_HotkeyManager.Data(iniKeyID))
So, to register it for the active program, add
ClientInformation.Applicationprocess like so:
Set registeredHotkeys(iniKeyID) =
Keyboard.RegisterHotkey(SO_HotkeyManager.Key(iniKeyID),
SO_HotkeyManager.Data(iniKeyID), ClientInformation.ApplicationProcess)
Clear as mud?
Steve
On 6/22/2011 4:06 PM, Vic Beckley wrote:
Steve,
I know how to do it that way, but the WEScript Framework uses the Hot Key
Manager from the toolkit to register the hot keys. I tried adding that
parameter to the lines where the hot keys were added and it would not take
it. At least I saw where the hot keys were all added. Is this what
registers
them to? Do I have to change the script and register my hot keys with the
Keyboard.RegisterHotkey method? If I do that, how do I get them to show up
in the Hot Key Manager object so they can be changed? I am a little
confused!
Vic
-----Original Message-----
From: Stephen Clower [mailto:[email protected]]
Sent: Wednesday, June 22, 2011 3:59 PM
To: [email protected]
Subject: Re: Advanced hot key topics
Vic,
To associate a hot key with an application, simply add a third parameter
to your RegisterHotKey routine. For example, the following snip
registers F9 to do something for whatever my active program happens to be:
Dim myKey : Set myKey = Keyboard.RegisterHotkey("F9", "DoSomething",
ClientInformation.ApplicationProcess)
Sub DoSomething
Speak "Howdy there."
End Sub
Steve
On 6/22/2011 3:53 PM, Vic Beckley wrote:
Chip,
Have you covered the advanced hot key topics. I know you mentioned it in
an
early class, class 10 I think, but I can't find any reference to it
later.
I
haven't been able to listen to all your classes, though.
The problem I am having is that it seems the WEScript Framework makes all
the hot keys global. I want to limit them to a specific application that
the
app is associated with. What is the easiest way to do this.
Thanks for any help on this and your classes are great.
Vic
--
Stephen Clower
Product support specialist
GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com