From fc805b57e2eddc51477b6e061adbcaeeb73032a9 Mon Sep 17 00:00:00 2001 From: Jorj Bauer Date: Wed, 20 Jan 2021 07:41:24 -0500 Subject: [PATCH] workaround for bug in Keypad library: need to set the pull-ups earlier, so the first reading isn't bad --- teensy/teensy-keyboard.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/teensy/teensy-keyboard.cpp b/teensy/teensy-keyboard.cpp index 5f48936..ea20ae5 100644 --- a/teensy/teensy-keyboard.cpp +++ b/teensy/teensy-keyboard.cpp @@ -81,6 +81,12 @@ static uint8_t shiftedNumber[] = { '<', // , TeensyKeyboard::TeensyKeyboard(VMKeyboard *k) : PhysicalKeyboard(k) { + // Need to set the rows to be pull-ups early, so the pullups have + // time to settle -- otherwise we get a phantom set of keypresses + // on startup for all the keys in the first column + for (byte i=0; i