Special Keys (arrows) + multiple key press

I'm facing a problem considering the (UP,DOWN,RIGHT,LEFT) arrows

when those four keys are pressed, the function doesn't feel with those keys

any other keys are detected.

private void form1_keyDown(object sender, System.Windows.Forms.KeyEventArgs e)

Also,i would like to know how to detect the press of multiple keys at the same time

thanks in advance



Answer this question

Special Keys (arrows) + multiple key press

  • LucianBordea

    sorry, but i don't understand what u meant by keeping track of events for keys i hope to detect

    Also, i am developing a real time game, so i need to get @ least 2 keys @ the same time. For example, right + up

    sorry for disturbance, and thnx


  • Danny Jr

    There is no event for multiple keys, each key generates an event. So, you need to keep track of events for keys that you hope to detect together and see if they get fired within a specific timeframe.



  • Siggy01

    You need to use DirectX if you're going to write a game. DX will keep track of multiple keys. The best you can do with straight C# is to detect key down and key up messages, and keep a list of which keys are down, that way you can detect if more than one key is down at once.

    It's really simple, the event only tells you one key. So, to tell if more than one is down, you need to write the code yourself.



  • Special Keys (arrows) + multiple key press