I've made a game where the task is to press spacebar 100 times which is mutiplayer, People are starting to use simple applications which spam the key "space" and I'm wondering if there is a way to only listen for user input or detect programs which are emulating key events.

I've not tested one of these programs but my program listens for KeyUp event.

Just tested: They can emulate key presses

有帮助吗?

解决方案

Best bet is to see if the time between all the spaces are exactly the same. A human would likely have some kind of variance. Make a judgement over some period of time.

其他提示

One big gotcha: All they need is to solder an oscillator to a donor keyboard and then it's not even visible inside any of the computer's processes. Sounds like a lot of work but you'd be surprised how hard people will work to cheat. Detect this with timing checks as mentioned above. Not a whole lot of people know how to make spread-spectrum clocks.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top