Closed BlackCapCoder closed 5 years ago
Nevermind- it's debounce and a duplicate of #30. I guess the difference between my left and right half are just slight variations in hardware; The m
key is never duplicated in my example, despite being on the right side of the keyboard.
Anyways, adding the elseif
part at the bottom here fixed the issue for me, with a refresh delay of 10:
if (Global.KeyState[j][i] == HIGH) // if key is down
{
if (Global.KeyStateCoolDown[j][i] == 0) // if key was not recently released
{
PressCoords(j, i);
Global.LayerState[j][i] = Global.TempLayer;
PrePress(PersMem.GetKeyData(j, i, Global.TempLayer), PersMem.GetKeyType(j, i, Global.TempLayer));
PressKey(PersMem.GetKeyData(j, i, Global.TempLayer), PersMem.GetKeyType(j, i, Global.TempLayer));
Global.KeyStateCoolDown[j][i] = 255;
} else if (Global.KeyStateCoolDown[j][i] != 255) {
Global.KeyStateCoolDown[j][i] = Global.RefreshDelay;
}
}
This may or may not the the same issue as #30.
I am getting a lot of double presses on the right half of my diverge 4, but not on the left. I have tested with the refresh rate set all the way up to 80, and the problem is still present, which leaves me doubtful that this is a debounce issue.
For reference, with a standard qwerty layout and the refresh rate set to
17
on the left half and50
on the right, I typed "lorem" a bunch of times:l
ando
are the only letters to be duplicated, both of which are on the right half of the keyboard. It is also curious that I always get double presses, never 3 or more which you would expect with debounce.