关于keyup keydown
本帖最后由 bcrun 于 2013-02-27 20:25:46 编辑
Const shift_key = 1
Const ctrl_key = 2
Const alt_key = 4
Const a_key = &H65
Const c_key = &H67
Const v_key = &H86
Private Sub Command1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = &H70 Then Print "按下F1"
End Sub
Private Sub Command1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = &H70 Then Print "松开F1"
End Sub
Private Sub Command2_Keydown(KeyCode As Integer, Shift As Integer)
If KeyCode = a_key And Shift = shift_key Then
Print "A"
ElseIf KeyCode = a_key And Shift = 0 Then
Print "a"
ElseIf KeyCode = c_key And Shift = ctrl_key Then
Print "复制"
ElseIf KeyCode = v_key And Shift = ctrl_key Then
Print "粘贴"
End If
End Sub