From fdf74434ce53cba7b85146a8cea59e1297a032e8 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 6 Apr 2022 14:29:58 +0200 Subject: [PATCH] Remove sample random key macro --- keymap.ino | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/keymap.ino b/keymap.ino index 5b98f6c..183b2d2 100644 --- a/keymap.ino +++ b/keymap.ino @@ -58,7 +58,6 @@ */ enum { MACRO_VERSION_INFO, - MACRO_ANY }; @@ -128,7 +127,7 @@ KEYMAPS( Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, ShiftToLayer(FUNCTION), - M(MACRO_ANY), Key_6, Key_7, Key_8, Key_9, Key_0, Key_Equals, + ___, Key_6, Key_7, Key_8, Key_9, Key_0, Key_Equals, Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Backslash, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, Key_RightAlt, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, @@ -181,27 +180,6 @@ static void versionInfoMacro(uint8_t keyState) { } } -/** anyKeyMacro is used to provide the functionality of the 'Any' key. - * - * When the 'any key' macro is toggled on, a random alphanumeric key is - * selected. While the key is held, the function generates a synthetic - * keypress event repeating that randomly selected key. - * - */ - -static void anyKeyMacro(uint8_t keyState) { - static Key lastKey; - bool toggledOn = false; - if (keyToggledOn(keyState)) { - lastKey.setKeyCode(Key_A.getKeyCode() + (uint8_t)(millis() % 36)); - toggledOn = true; - } - - if (keyIsPressed(keyState)) - Kaleidoscope.hid().keyboard().pressKey(lastKey, toggledOn); -} - - /** macroAction dispatches keymap events that are tied to a macro to that macro. It takes two uint8_t parameters. @@ -216,14 +194,9 @@ static void anyKeyMacro(uint8_t keyState) { const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { switch (macroIndex) { - case MACRO_VERSION_INFO: versionInfoMacro(keyState); break; - - case MACRO_ANY: - anyKeyMacro(keyState); - break; } return MACRO_NONE; }