What is the code for if the user holds the 3, 0, 2, and 1 all at the same time and that triggers a new window to come up.
how would i do that?
GetKeyboardState API function is your best bet.
[php]
Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
[/php]
Example:
[php]
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll")> _
Public Shared Function GetKeyboardState(ByVal keystate As Byte()) As Integer
End Function
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
Dim keys__1 As Byte() = New Byte(254) {}
GetKeyboardState(keys__1)
If keys__1(CInt(Keys.Up)) = 129 AndAlso keys__1(CInt(Keys.Right)) = 129 Then
Console.WriteLine("Up Arrow key and Right Arrow key down at the same time")
End If
End Sub
End Class
[/php]
Virtual Keys
[php]
Imports System.Runtime.InteropServices
Imports System
Imports System.Collections.Generic
Imports System.Text
Namespace PInvoke.Net
Public Class Keyboard
<DllImport("user32.dll")> _
Private Shared Function GetKeyState(ByVal nVirtKey As VirtualKeyStates) As Short
End Function
Public Shared Function IsKeyPressed(ByVal testKey As VirtualKeyStates) As Boolean
Dim keyPressed As Boolean = False
Dim result As Short = GetKeyState(testKey)
End Enum
End Class
End Namespace
Public Class Form1
<DllImport("user32.dll")> _
Public Shared Function GetKeyboardState(ByVal keystate As Byte()) As Integer
End Function
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
Dim keys__1 As Byte() = New Byte(254) {}
GetKeyboardState(keys__1)
If keys__1(CInt(Keys.Up)) = 129 AndAlso keys__1(CInt(Keys.Right)) = 129 Then
Console.WriteLine("Up Arrow key and Right Arrow key down at the same time")
End If
End Sub
End Class
[/php]