Compare commits

...

2 commits

Author SHA1 Message Date
Antoine Martin fdf74434ce Remove sample random key macro 2022-04-06 14:29:58 +02:00
Antoine Martin 9f558785f5 Remove unused code 2022-04-06 14:29:33 +02:00

View file

@ -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;
}
@ -253,21 +226,6 @@ void hostPowerManagementEventHandler(kaleidoscope::plugin::HostPowerManagement::
toggleLedsOnSuspendResume(event);
}
/** This 'enum' is a list of all the magic combos used by the Model 01's
* firmware The names aren't particularly important. What is important is that
* each is unique.
*
* These are the names of your magic combos. They will be used by the
* `USE_MAGIC_COMBOS` call below.
*/
enum {
// Toggle between Boot (6-key rollover; for BIOSes and early boot) and NKRO
// mode.
COMBO_TOGGLE_NKRO_MODE,
// Enter test mode
COMBO_ENTER_TEST_MODE
};
// First, tell Kaleidoscope which plugins you want to use.
// The order can be important. For example, LED effects are
// added in the order they're listed here.