Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check only specified key is down

Tags:

.net

wpf

I can check whether key is down by Keyboard.IsKeyDown method. But how can I check specified key is only key which is down?

like image 661
SiberianGuy Avatar asked May 01 '26 02:05

SiberianGuy


1 Answers

There is a way to get the current keyboard state and work out what keys are pressed, but its a bit messy and uses the user32.dll. Have a look at the answer to this one.

https://stackoverflow.com/a/1752761/1232571

like image 172
Ben Avatar answered May 02 '26 16:05

Ben