Try this: I changed the first line.

Dim myHotkey : Set myHotkey = Keyboard.RegisterHotkey("f2","ListenForKey")

sub listenforkey()
speak " listening for key input"
dim mykey : set mykey = keyboard.Capture()

speak "the key pressed was " & mykey.name
end sub


  ----- Original Message ----- 
  From: Juan Hernandez 
  To: [email protected] 
  Sent: Thursday, January 08, 2009 11:51 AM
  Subject: capture key


  Hi guys,

  so I'm trying to setup a method when I hit a key, like f2, to put window-eyes 
in a small wait period. and allow me to hit a letter on my keyboard, and 
perform a certain task, below is some really basic code.

  dim myreghotkey = set myreghotkey = 
keyboard.registerhotkey("f2","listenforkey",clientinformation.applicationprocess)
  sub listenforkey()
  speak " listening for key input"

  dim mykey : set mykey = keyboard.Capture()
  speak "the key pressed was " & mykey.name
  end sub


  when I hit f2 it says  listening for key input.  and I would assume that 
because I have the capture next, that it should take in my next key press?  
nothing happens, it doesn't speak the text that is in the sub.

  any ideas? I'm sure I'm doing something really stupid.

  Thanks.
    

  Juan Hernandez
  [email protected]
  858-699-2105

Reply via email to