Detect if any key is pressed in C# (not A, B, but any)

前端 未结 9 2322
粉色の甜心
粉色の甜心 2020-12-01 08:32

[EDIT 3] I kind of "solved it" by at using the "strange" version. At least for the most important keys. It is suffient for my case, where I want to check

9条回答
  •  星月不相逢
    2020-12-01 09:21

    Using the XNA framework you can use thw follow for checking if any key has been pressed.

    Keyboard.GetState().GetPressedKeys().Length > 0
    

提交回复
热议问题