From 6dcc6a9277ae5a30c32c98f6dc85d2738f274f79 Mon Sep 17 00:00:00 2001 From: "James N. V. Cash" Date: Thu, 26 Oct 2017 08:16:48 -0400 Subject: [PATCH] Teach plugin to print out the contents of a given layer --- src/Kaleidoscope/EEPROM-Keymap.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Kaleidoscope/EEPROM-Keymap.cpp b/src/Kaleidoscope/EEPROM-Keymap.cpp index af6d5507..7d83e792 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.cpp +++ b/src/Kaleidoscope/EEPROM-Keymap.cpp @@ -115,8 +115,18 @@ bool EEPROMKeymap::focusKeymapLayer(const char *command) { uint8_t layer = Serial.parseInt(); uint16_t keysPerLayer = ROWS * COLS; uint16_t offset = layer * keysPerLayer; - for (uint16_t k = 0; (k < keysPerLayer) && (Serial.peek() != '\n'); k++) { - updateKey(layer + k, parseKey()); + if (Serial.peek() == '\n') { + for (uint8_t row = 0; row < ROWS; row++) { + for (uint8_t col = 0; col < COLS; col++) { + Key k = Layer.getKey(layer, row, col); + printKey(k); + ::Focus.printSpace(); + } + } + } else { + for (uint16_t k = 0; (k < keysPerLayer) && (Serial.peek() != '\n'); k++) { + updateKey(layer + k, parseKey()); + } } return true;