Hi David,
Jonathin's right, you can dig it out of your code if you work at it. This
falls under the rule I follow for not understanding something in scripting: if
it's not easily found in the developer's manual, then check the help for the GW
toolkit. That's where you'll find it in this case. In the help for the
toolkit you actually have to click on the button to launch the help, and then
you'll be in a manual for all of the toolkit objects.
I've copied out the top level topic for the hotkey manager for your convenience
below. I will admit to feeling that even with the documentation, this is still
(in general), a difficult topic to understand thoroughly (so don't hesitate to
ask questions if necessary):
Navigation: GW Micro App Toolkit
<mk:@MSITStore:C:\Users\Chip\AppData\Roaming\GW%20Micro\Window-Eyes\users\default\gwtoolkit.chm::/gwtk_introduction.htm>
> Objects
<mk:@MSITStore:C:\Users\Chip\AppData\Roaming\GW%20Micro\Window-Eyes\users\default\gwtoolkit.chm::/gwtk_objects.htm>
>
HotkeyManager
<mk:@MSITStore:C:\Users\Chip\AppData\Roaming\GW%20Micro\Window-Eyes\users\default\gwtoolkit.chm::/obj_getdialogxml.htm>
Previous page
<mk:@MSITStore:C:\Users\Chip\AppData\Roaming\GW%20Micro\Window-Eyes\users\default\gwtoolkit.chm::/gwtk_objects.htm>
Return to chapter overview
<mk:@MSITStore:C:\Users\Chip\AppData\Roaming\GW%20Micro\Window-Eyes\users\default\gwtoolkit.chm::/properties.htm>
Next page
This object provides an easy way to manage multiple hot keys for a given app.
The Hotkey Manager dialog can be called directly, providing hot key management
anywhere in an app, or by using the StandardHelpDialog
<mk:@MSITStore:C:\Users\Chip\AppData\Roaming\GW%20Micro\Window-Eyes\users\default\gwtoolkit.chm::/obj_standardhelpdialog.htm>
object, providing hotkey management when the View Help button is selected in
the App Manager dialog.
Example 1
' This example launches the hotkey manager dialog directly
Set HotkeyManager =
SharedObjects("com.GWMicro.GWToolkit.HotkeyManager").NewDialog
HotkeyManager.INIFileName = "myini.ini"
HotkeyManager.INISectionName = "Hotkeys"
Set HotkeyManager.KeyStrings = Strings("myxmlfile.xml")
HotkeyManager.Manager
Example 2
' This example launches the hotkey manager with two default hotkeys
Set HotkeyManager =
SharedObjects("com.GWMicro.GWToolkit.HotkeyManager").NewDialog
HotkeyManager.INIFileName = "myini.ini"
HotkeyManager.INISectionName = "hotkeys"
Set HotkeyManager.KeyStrings = Strings("myxmlfile.xml")
HotkeyManager.Add "Key01", "Control-Shift-3", "FunctionOne"
HotkeyManager.Add "Key02", "Control-Shift-Y", "FunctionTwo"
HotkeyManager.Manager
Registering Hotkeys
The following routine demonstrates how to register your hotkeys whether you're
registering your default hotkeys for the first time, or are re-registering
hotkeys after a user changes them using the Hotkey Manager dialog.
' Registered hotkeys are stored in a global Dictionary object:
Dim HotkeyManager : Set HotkeyManager =
SharedObjects("com.GWMicro.GWToolkit.HotkeyManager").NewDialog
If Not HotkeyManager Is Nothing Then
HotkeyManager.INIFileName = myINIFile
HotkeyManager.INISectionName = mySectionName
Set HotkeyManager.KeyStrings = myStrings
End If
Dim registeredHotkeys : Set registeredHotkeys =
CreateObject("Scripting.Dictionary")
Sub RegisterHotkeys()
' Step 1: Verify the HotkeyManager object exists
If Not HotkeyManager Is Nothing Then
' Step 2: If the INI does not already contain hotkeys, add default hotkeys.
If UBound(Split(INIFile(myINIFile).GetSectionKeys(myINISection),
vbNullChar)) < 0 Then
HotkeyManager.Add "Key01", "Control-Alt-1", "FirstKeyFunction"
HotkeyManager.Add "Key02", "Control-Alt-2", "SectionKeyFunction"
End If
' Step 3: Remove existing hotkey registrations if they exist
If Not registeredHotkeys Is Nothing Then
registeredHotkeys.RemoveAll
End If
' Step 4: Obtain all hotkeys from the INI file
Dim iniArray : iniArray =
Split(IniFile(myINIFile).GetSectionKeys(myINISection), vbNulLChar)
' Step 5: Register each hotkey, and store the registration in the
global dictionary
Dim iniKeyID
For Each iniKeyID In iniArray
Set registeredHotkeys(iniKeyID) =
Keyboard.RegisterHotkey(HotkeyManager.Key(iniKeyID),
HotkeyManager.Data(iniKeyID))
Next
End If
End Sub
' With this routine in place, you can register hotkeys when your app starts,
when you return from a GW Toolkit object that uses
' the Hotkey Manager (such as the StandardHelpDialog object), or anywhere else
you want to re-read hotkeys from your INI file,
' and re-register them.
-----Original Message-----
From: David [mailto:[email protected]]
Sent: Monday, January 12, 2015 3:42 PM
To: [email protected]
Subject: Accessing the Hotkey Manager Dialog
I have searched the reference manual, but don't seem to find what I want.
Is there any way, or could it be provided in later versions, to have my
script bring up the Hotkey Manager Dialog? That is, the dialog where the
user can change the hotkeys of the app, or simply just look through the
shortcuts provided.
I could, of course, have the app bring up the SO_StandardHelp dialog,
and then hope for the user to tab around the screen in his hunt for the
button to get to the hotkey manager. But I would much rather have liked
to send him directly, where I want him to go.
Any ideas?
Thanks,
--
David