I can check if a key is pressed Keyboard.IsKeyDown . But how can I check the specified key, it is only the key not working?
Keyboard.IsKeyDown
There is a way to get the current state of the keyboard and determine what keys are pressed, but it's a bit messy and uses user32.dll. Look at the answer to this question.
fooobar.com/questions/510323 / ...
depending on which key you want to check, do something like this
if(Keyboard.IsKeyDown(Key.LeftCtrl)) //do something
Or if you only want to do something if you press that key, try something like
if(!Keyboard.IsKeyDown(Key.LeftCtrl)) return;
This will kick them out of the function if no key is pressed.
Perhaps you can count the number of KeyDown and KeyUp? If the counter is 1 and this is the key you want ....