Results 1 to 2 of 2

Thread: KeyCode when two buttons are pressed

  1. #1

    Thread Starter
    Hyperactive Member Matt-D's Avatar
    Join Date
    Nov 1999
    Location
    Mettmann, Germany
    Posts
    305

    KeyCode when two buttons are pressed

    english
    Just to make it simple: When I press 'Ctrl'
    (Global Const KEY_CONTROL = &H11) and
    'left' (Global Const KEY_LEFT = &H25) at
    the same time I want a Messagebox to appear.
    What's the keycode for this ?

    Thanks, Matt


    deutsch
    Welchen keycode muß ich nutzen, damit eine
    Nachricht angezeigt wird, wenn der Benutzer zwei
    Tasten drückt? Zum Beispiel 'Strg' (Global Const
    STRG_TASTE = &H11) und 'links' (Global Const NACH_LINKS_TASTE = &H25)?

    Danke, Matze

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Set the Form's KeyPreview property to True, then
    VB Code:
    1. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    2.  
    3.     If Shift = vbCtrlMask And KeyCode = vbKeyLeft Then
    4.         MsgBox "Ctrl + Left"
    5.     End If
    6.  
    7. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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