Results 1 to 4 of 4

Thread: sendkeys used with function keys and others

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    88

    Post

    i've been trying to use the sendkeys function to trigger some events in another application. everything works fine until i try to do an Alt-v or an F9. this is my syntax:

    sendkeys "%(v)" 'alt-v
    sendkeys "{F9}" 'f9

    i get no response from either of these. i've doubled checked to see that these are indeed the correct keystrokes and that they'll work regardless of cursor location. everything checks out.

  2. #2
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Post

    Hello,

    Are you testing with a DOS application?
    If yes, you have a problem.

    If your Windows application is correct working with your keyboard keys, it must work (thats my experience)

    a other possibility is to use:

    sendkeys "%(v)", True
    sendkeys "{F9}", True

    The Boolean True: keystrokes must be processed before control is returned to the procedure.

    Nice regards,

    Michelle

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    88

    Post

    thanks for your help, michelle. after playing with the program, i figured out half of the problem. whenever i use the % for alt, the receiving program attempts to locate a menu item and not a shortcut key. i just found a way to work around it and it goes just fine. the "{F9}" statement, however, i have no idea why it doesn't work. i used you suggestions and still nothing. just an odd note, if i use the same statement i have been using in the immediate window, everything works fine. if i put it into my program, it bombs.

    thanks again.

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Post

    Darell,
    You may want to try sending the Escape key before sending F9 just in case the menu is retaining its focus.
    Wade

    [This message has been edited by WadeD (edited 02-18-2000).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width