Results 1 to 5 of 5

Thread: Capturing 'F1' Keystroke

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    39

    Post

    There a way to capture an F1 keystroke? It doesn't have an ascii code...

  2. #2
    Junior Member
    Join Date
    Oct 1999
    Posts
    31

    Post

    You have to use either KeyUp or KeyDown. And check for KeyCode = vbKeyF1

  3. #3
    New Member
    Join Date
    Dec 1999
    Location
    Bethlehem, PA US
    Posts
    10

    Post

    It doesn't have a "keypress" ascii value but it does have a "keycode" that can be captured in the "KeyDown" event(say of a test box). The keycode is 112 for F1 but you'll find more in the MSDN under "Keycode constants"

  4. #4
    Member
    Join Date
    Sep 1999
    Location
    Texas, US
    Posts
    45

    Post

    Ok, to find any keycode goto your form_keydown event and type in Debug.Print KeyCode. This will type a number in the visual basic "Imediate Box". That number is the number of the key typed. Now just type in a statement like: If keycode = 112 then msgbox "You pressed F1". The keycode for F1 is 112.

  5. #5

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    39

    Post

    thanks. =))

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