I was searching some informations about custom keyboards and I found something about chattering, so I've made a circuit to correct that:
the sine signals and the op-amp are just here to simulate a switch bouncing
for a software implementation, the idea is very simple: once the signal state changes, wait (settable amount of time)ms before refresh that key state
to do that, we could start with an array of unsigned integers (char, short, int, long) and obviously a boolean output array
then if the coresponding number of switch in the array == 0 && if a switch state change is detected (hardware signal != output array)
{
put a number into that array (depending on the frequency of matrix sweep and the time setted) and change the state of the switch in the output array (output_array[that switch] = ~output_array[that switch])
}
else decrease this number (array[that switch]--;)