Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

is there a way to detect all the key pressed in keydown event of the form? For example im currently pressing CRTL + Alt + A can i get all the keys in keydown event? i need to get all the keys to create my own hot keys in my currently developing application

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
382 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can check for all keys in event arguments

private void Form1_KeyDown(object sender, KeyEventArgs e)
{
    if (e.Alt && e.Control && e.KeyCode == Keys.A)
    {
        //do something
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...