- Joined
- Nov 30, 2007
- Messages
- 1,202
There are a few methods to check key events: wait for event in a separate thread, event polling and finally key-state checks. All of these methods probably work pretty much in the same way behind the scenes, mainly checking for key-states and handling it accordingly.
This brings me to my problem, my keyboard sends press and release events when a key is held down, and i need advice on how to distinguish between human behavior and well, spam.
I have tried built in stuff like SDL_EnableKeyRepeat(0,0) which supposedly disables the repeat, Also tested the flag event.key.repeat, but that doesn't work as the events that are fired through holding in is hardware related. So that leaves me to accepting fluke events or trying to make a work around,
I'm thinking timestamps is the best way forward here, but then, don't I run the risk of mistaking real events for fake ones?
Any ideas? Is there a script that I could implement that could temporarily disable this for the user? Maybe I shouldn't ask at hive, but it's not the first forum I've asked on. ^^
This brings me to my problem, my keyboard sends press and release events when a key is held down, and i need advice on how to distinguish between human behavior and well, spam.
I have tried built in stuff like SDL_EnableKeyRepeat(0,0) which supposedly disables the repeat, Also tested the flag event.key.repeat, but that doesn't work as the events that are fired through holding in is hardware related. So that leaves me to accepting fluke events or trying to make a work around,
I'm thinking timestamps is the best way forward here, but then, don't I run the risk of mistaking real events for fake ones?
Any ideas? Is there a script that I could implement that could temporarily disable this for the user? Maybe I shouldn't ask at hive, but it's not the first forum I've asked on. ^^
Last edited: