Results 1 to 5 of 5

Thread: KeyAscii

  1. #1

    Thread Starter
    Hyperactive Member naruponk's Avatar
    Join Date
    Feb 2004
    Location
    Some where in the world
    Posts
    423

    Lightbulb KeyAscii

    Hello,

    Does anyone know that how to get KeyAscii of upbutton, leftbutton, rightbutton, downbutton, F1 ... , F12


    Thanks

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    No such thing. Ascii codes are character codes, not key codes.

  3. #3

    Thread Starter
    Hyperactive Member naruponk's Avatar
    Join Date
    Feb 2004
    Location
    Some where in the world
    Posts
    423
    Ok, so how can i know that user has press keyup, keydown?

  4. #4
    Fanatic Member Wen Lie's Avatar
    Join Date
    Jul 1999
    Location
    Singapore
    Posts
    524
    at object keydown event.

    e.g : (object = Text1)
    VB Code:
    1. Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    2.     Select Case KeyCode
    3.         Case vbKeyUp
    4.             'user press up arrow
    5.         Case vbKeyDown
    6.             'user press down arrow
    7.         Case vbKeyReturn
    8.             'user press enter
    9.         Case vbKeyLeft
    10.             'user press left arrow
    11.         Case vbKeyRight
    12.             'user press right arrow
    13.         Case vbKeyF1
    14.             'user press F1 button
    15.         Case vbKeyF12
    16.             'user press F12 button
    17.     End Select
    18. End Sub

    for F1 - F12, you can use vbKeyFn ... Change the n with 1 - 12, depends on what key you need to check.

    Hope it helps..
    Regards,
    [-w-]

  5. #5

    Thread Starter
    Hyperactive Member naruponk's Avatar
    Join Date
    Feb 2004
    Location
    Some where in the world
    Posts
    423
    Thank you very much

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