Private Sub kbHook_KeyDown(ByVal Key As System.Windows.Forms.Keys) Handles kbHook.KeyDown
If Keys.Control And Keys.Alt And Keys.Shift And Keys.N Then
Me.Opacity = 100
Me.ShowInTaskbar = True
Me.ShowIcon = True
MsgBox("CTRL + ALT + SPACE") ' This work
Me.BackColor = Color.Indigo
CheckBox3.Checked = False
End If
End Sub
我使用question,我希望键盘在后台时能听到多个按键,但这是行不通的。怎么了?
答案 0 :(得分:2)
这对我有用:
Private Sub kbHook_KeyDown(Key As Keys) Handles kbHook.KeyDown
If My.Computer.Keyboard.CtrlKeyDown AndAlso
My.Computer.Keyboard.AltKeyDown AndAlso
My.Computer.Keyboard.ShiftKeyDown AndAlso
Key = Keys.N Then
Debug.Print("Ctl-Alt-Shift-N")
End If
End Sub