using System . Runtime . InteropServices;
[ DllImport ( "user32.dll" )]
public static extern short GetKeyState( int nVirtKey);
public const int VK_LEFT = 37 ;
public const int VK_UP = 38 ;
public const int VK_RIGHT = 39 ;
public const int VK_DOWN = 40 ;
private void Form1_KeyDown( object sender , KeyEventArgs e)
{
switch (e . KeyCode)
{
case Keys . Left:
case Keys . Right:
case Keys . Down:
case Keys . Up:
if (((GetKeyState(VK_RIGHT) & 0x80 ) == 0x80 ) &&
((GetKeyState(VK_DOWN) & 0x80 ) == 0x80 ))
MessageBox . Show( "Zswang );
break ;
}
}