Skip to content

Instantly share code, notes, and snippets.

@DanielGGordon
Last active May 22, 2023 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielGGordon/6c743f3ff25f726ff757f79986eb763e to your computer and use it in GitHub Desktop.
Save DanielGGordon/6c743f3ff25f726ff757f79986eb763e to your computer and use it in GitHub Desktop.
Daniel Gordon's QMK Userspace code including secret file
#ifndef GORDON
#define GORDON
const char secret[][64] = {
"xxxxxxxxxxx",
"ttttttttttt",
"test3",
"test4",
"test5"
};
#endif
#include "gordon.h"
#include "quantum.h"
#include "action.h"
#include "process_keycode/process_tap_dance.h"
#if (__has_include("secret.h"))
#include "secret.h"
#else
const char secret[][64] = {
"test1",
"test2",
"test3",
"test4",
"test5"
};
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_SECRET_1 ... KC_SECRET_5:
if (!record->event.pressed) {
send_string(secret[keycode - KC_SECRET_1]);
}
return false;
break;
}
return true;
}
#ifndef GORDON
#define GORDON
#include "quantum.h"
#include "process_keycode/process_tap_dance.h"
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
enum secret_strings {
KC_SECRET_1 = SAFE_RANGE,
KC_SECRET_2,
KC_SECRET_3,
KC_SECRET_4,
KC_SECRET_5,
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment