View Single Post
Old 11-16-2007, 04:34 PM   #3
Derkel
N00B Pwner
 
Last Online: 10-07-2009 10:14 PM
Join Date: Apr 2007
Location: In a House
Posts: 453
Rep Power: 3
Rep Points: 10
Derkel is on a distinguished road
Feedback: (2)
Points: 7,615.51
Bank: 38,432.60
Total Points: 46,048.11
Autism - Derkel 
Xfire derkel
Re: Mega Post of Tuts

A list of Key Codes
vbKeyControl 'CTRL Key
vbkeymenu 'ALT key
vbKeyReturn 'Enter Key (Main)
vbKeyBack 'Back Space
vbKeyTab 'Tab
vbKeyShift 'Shift
vbKeyCapital 'Caps Lock
vbKeyEscape 'Esc
vbKeySpace ' Space Bar
vbKeyPageUp ' Page Up
vbKeyPageDown ' Page Down
vbKeyEnd 'End
vbKeyHome ' Home
vbKeyLeft 'Left arrow
vbKeyUp 'Up arrow
vbKeyRight 'Right Arrow
vbKeyDown ' Down Arrow
vbKeyPrint 'Print Screen
vbKeyPause 'Pause (The one next to printscreen)
vbKeyInsert 'Insert
vbKeyDelete 'Delete (the one near insert)
vbKeyHelp 'Help
vbKeyNumlock ' Numlock
vbKeyF1 'F1
vbKeyF2 'F2
vbKeyF3 'F3
vbKeyF4 'F4
vbKeyF5 'F5
vbKeyF6 'F6
vbKeyF7 'F7
vbKeyF8 'F8
vbKeyF9 'F9
vbKeyF10 'F10
vbKeyF11 'F11
vbKeyF12 'F12
vbKeyZ 'Z
vbKeyx 'X
vbKeyc 'C
vbKeyv 'V
vbKeyb 'B
vbKeyn 'N
vbKeym 'M
vbKeya 'A
vbKeys 'S
vbKeyd ' D
vbKeyf 'F
vbKeyg 'G
vbKeyh 'H
vbKeyj 'J
vbKeyk 'K
vbKeyl 'L
vbKeyq 'Q
vbKeyw 'W
vbKeye 'E
vbKeyr 'R
vbKeyt 'T
vbKeyy 'Y
vbKeyu 'U
vbKeyi 'I
vbKeyo 'O
vbKeyp 'P
vbKeyNumpad0 'Num Pad 0
vbKeyNumpad1 'Num Pad 1
vbKeyNumpad2 'Num Pad 2
vbKeyNumpad3 'Num Pad 3
vbKeyNumpad4 'Num Pad 4
vbKeyNumpad5 'Num Pad 5
vbKeyNumpad6 'Num Pad 6
vbKeyNumpad7 ' Num Pad 7
vbKeyNumpad8 'NumPad 8
vbKeyNumpad9 'Num Pad 9
vbKeyMultiply 'Num Pad *
vbKeyAdd 'Num Pad +
vbKeySubtract 'Num Pad -
vbKeyDivide 'Num Pad /
vbKeySeparator 'Num Pad Enter
vbKeyDecimal 'Num Pad .
vbKey0 'Normal 0 from top of keyboard
vbKey1 'Normal 1 from top of keyboard
vbKey2 'Normal 2 from top of keyboard
vbKey3 'Normal 3 from top of keyboard
vbKey4 'Normal 4 from top of keyboard
vbKey5 'Normal 5 from top of keyboard
vbKey6 'Normal 6 from top ofkeybaorrd
vbKey7 'Normal 7 from top of keyboard
vbKey8 'Normal 8 from top of keybaord
vbKey9 'Normal 9 from top of keyboard
-------------------------------------
Heres how to use them:
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift _
As Integer)
If KeyCode = vbKeyBack Then
MsgBox " You pushed backSpace" 'That is changed to what _
you want it to do when they push it
End If 'Remember for every If you must have a end if
End Sub
Now For the mouse Buttons:

vbKeyLButton 'Left mouse Button

vbKeyRButton 'Right Mouse Button

vbKeyMButton 'Middle mouse Button

And to use them its a bit different
Code:
Private Sub Form_MouseDown(Button As Integer, Shift _
As Integer, X As Single, Y As Single)
If Button = vbKeyLButton Then
MsgBox " You pushed the left mouse button" 'The code _
you want it to do goes there
End If ' remember for every If you need End If
End Sub

Last edited by Derkel; 11-16-2007 at 04:42 PM.
Derkel is offline   Reply With Quote