I need a fast and reliable way to do key debouncing (basically if I press and hold a key, it only does one keypress until I release it and press it again)
what I have right now is super janky and I'm pretty sure it is the root cause of my problems with the program not always recognizing keypresses:
Code:
Then whenever I have something that needs to detect keys, an example of the if statement is
Code:
I really need a better way to do this because if my hunch is correct this is not the way to go.
what I have right now is super janky and I'm pretty sure it is the root cause of my problems with the program not always recognizing keypresses:
Code:
kb_Scan();
if(!kb_AnyKey())
{
debounce = 0;
}
Then whenever I have something that needs to detect keys, an example of the if statement is
Code:
if(kb_ScanGroup(kb_group_7) == kb_Down && debounce == 0)
{
debounce = 1;
[other code]
}
I really need a better way to do this because if my hunch is correct this is not the way to go.