diff --git a/src/keyboard.c b/src/keyboard.c index 4110d82..7b077dd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2,10 +2,10 @@ #include extern uint8_t systemRegister; +extern uint8_t keyboardResult; +extern sfKeyCode currentKey; -static uint8_t keyboardResult; - -static sfKeyCode scanMatrix[48] = { +const static sfKeyCode scanMatrix[48] = { sfKeyNum1, sfKeyNum2, sfKeyNum3, sfKeyNum4, sfKeyNum5, sfKeyNum6, sfKeyNum7, sfKeyNum8, sfKeyQ, sfKeyW, sfKeyE, sfKeyR, sfKeyT, sfKeyY, sfKeyU, sfKeyI, sfKeyA, sfKeyS, sfKeyD, sfKeyF, sfKeyG, sfKeyH, sfKeyJ, sfKeyK, @@ -15,11 +15,11 @@ static sfKeyCode scanMatrix[48] = { }; -void scanKeyboard(const sfKeyCode key){ +void scanKeyboard(){ keyboardResult = 0; for (int i = 0; i < 8; i++) { - if (key == scanMatrix[i + (((systemRegister & 0x07) % 6) * 8)]){ + if (currentKey == scanMatrix[i + (((systemRegister & 0x07) % 6) * 8)]){ keyboardResult |= (0x80 >> i); } }