Fixed key press/release to match reality

This commit is contained in:
Mattias Lasersköld 2020-03-05 17:56:32 +01:00
parent f76fe8a787
commit e053a7b4b0
3 changed files with 7 additions and 5 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@ software/arduino/.cproject
software/arduino/.project software/arduino/.project
software/arduino/.settings/ software/arduino/.settings/
.vscode/ .vscode/
software/arduino/sim/sim

View File

@ -12,7 +12,7 @@
#include "pins.h" #include "pins.h"
// Standad layer // Standad layer
const char *keyConfig1 = "§12345" const char *keyConfig1 = "\6912345" // Fix this. Put in the right scancodes
"\tQWERT" "\tQWERT"
"\177ASDFG" "\177ASDFG"
"\129<ZXCV" "\129<ZXCV"
@ -41,14 +41,14 @@ void changeColumnPin(size_t column) {
void readRowPins(keyboard_state_t &keyboardState, size_t x) { void readRowPins(keyboard_state_t &keyboardState, size_t x) {
for (size_t y = 0; y < height; ++y) { for (size_t y = 0; y < height; ++y) {
int value = digitalRead(yPins[y]); int value = digitalRead(yPins[y]);
auto &keyState = keyboardState.state(x, y); auto &storedKeyState = keyboardState.state(x, y);
if (keyState != value) { if (storedKeyState != value) {
Serial.print("readRowPins: key is changed "); Serial.print("readRowPins: key is changed ");
Serial.print(x); Serial.print(x);
Serial.print(y); Serial.print(y);
keyboardMap.publishEvent(x, y, keyState); keyboardMap.publishEvent(x, y, value);
keyState = value; storedKeyState = value;
} }
} }
} }

Binary file not shown.