Martin,
You have a logic problem. In the line:
If Keyboard.KeyDescriberActive Then MyHotKey(parm)
is fine but this just says if the key describer is active call the sub
MyHotKey. But when that function is finished, execution will start at
the next line. So maybe something like this instead:
If Keyboard.KeyDescriberActive Then
MyHotKey(parm)
Exit Sub
End If
Make sense?
Doug
martin webster wrote:
Hi all,
the short script below allows keystrokes to go through to the rest of the
script when the key describer is active. What have I got wrong here?. When the
Key describer is active I just want a description of what the G and H keys will
do no more. What is happening now is I am getting the description and the
script is then going on to perform the action. I am using window-eyes 7.3 beta
and windows XP pro.
Warm regards.
Martin Webster. ' keyboard example using the key describer
' this example is using two hotkeys and describing what
' the function HandleKey will do using the WindowEyes key describer.
Dim MyKeyH, MyKeyG, MyKeydescriptionH, MyKeydescriptionG, eventShutdown
MyKeydescriptionH = "when h is pressed, win-eyes will say hello"
MyKeydescriptionG = "when g is pressed window-eyes will say goodbye"
Set MyKeyH = Keyboard.RegisterHotkey("h", "HandleKey", Nothing, 1)
Set MyKeyG = Keyboard.RegisterHotkey("g", "HandleKey", Nothing, 2)
eventShutdown = ConnectEvent (ClientInformation, "OnShutdown", "OnShutdown")
Function HandleKey(parm)
If Keyboard.KeyDescriberActive Then MyHotKeys(parm)
Select Case parm
Case 1
speak "hello"
Case 2
Speak "goodbye"
End Select
End Function
Sub MyHotKeys(parm)
Select Case parm
Case 1
Speak MyKeydescriptionH
Case 2
Speak MyKeydescriptionG
End Select
End Sub
Sub OnShutdown()
Speak "I'm off now"
MyKeyH.UnRegister : MyKeyG.UnRegister
Set MyKeyH = Nothing : Set MyKeyG = Nothing
Disconnect eventShutdown
End Sub
--
Doug Geoffray
GW Micro, Inc.
Voice 260-489-3671
Fax 260-489-2608
http://www.gwmicro.com