From 4410f028e3b8b7d5fafd1648d74a253f86d5b53b Mon Sep 17 00:00:00 2001 From: Sergei Panarin Date: Sun, 15 Dec 2019 14:53:49 +0300 Subject: [PATCH] Update SmartyKitApple1_KeyboardDriver.ino Updated delay time to prevent repeating of keyboard input chars --- .../SmartyKitApple1_KeyboardDriver.ino | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/SmartyKitApple1_KeyboardDriver/SmartyKitApple1_KeyboardDriver.ino b/SmartyKitApple1_KeyboardDriver/SmartyKitApple1_KeyboardDriver.ino index bbcecc1..93a96ca 100644 --- a/SmartyKitApple1_KeyboardDriver/SmartyKitApple1_KeyboardDriver.ino +++ b/SmartyKitApple1_KeyboardDriver/SmartyKitApple1_KeyboardDriver.ino @@ -56,7 +56,7 @@ void loop() { // read the next key char c = keyboard.read(); - + /* // check for some of the special keys if (c == PS2_ENTER) { Serial.println(); @@ -83,7 +83,18 @@ void loop() { // otherwise, just print all normal characters Serial.print(c); } + */ + + //process Backspace, Left Arrow, Delete as Apple I backspace '_' + if (c == PS2_BACKSPACE) { + c = '_'; + } else if (c == PS2_LEFTARROW) { + c = '_'; + } else if (c == PS2_DELETE) { + c = '_'; + } + //print c to register for (int count = 1; count <= 8 ; count++) { @@ -94,6 +105,6 @@ void loop() { } digitalWrite(DataBus[7], HIGH); KBDCR_Enable(); - delay(20); + delay(4); } }