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

前端 未结 9 2327
粉色の甜心
粉色の甜心 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:04

    You can increment a counter for each keydown event, and decrement it for each keyup event. When the counter is zero, no keys are down.

提交回复
热议问题