#include <stdio.h>
#include <time.h>
#include "ridingqwerty.h"
#include "dict.h"
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
/*
typedef union {
struct {
uint8_t aesthetic : 1,
spongebob : 1,
uppercase : 1,
australia : 1,
unusued : 4;
};
uint8_t all;
} mode_config_t;
*/
mode_config_t mode = {.all = 0U};
bool randword_seed = false;
uint8_t user_mod_state;
uint16_t rand_key;
uint16_t temp_keycode;
uint32_t user_key_timer;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef CONSOLE_ENABLE
uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
#endif
temp_keycode = keycode;
if ((mode.all != 0U) && ((keycode != DB(TAB) || keycode != ED(ESC)) && ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)))) {
temp_keycode &= 0xFF;
if (mode.spongebob) {
switch(temp_keycode) {
case KC_A ... KC_Z:
if (record->event.pressed) {
(mode.uppercase ^= 1) == 0 ? tap_code16(S(temp_keycode)) : tap_code(temp_keycode);
return false;
if (mode.aesthetic) {
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE)
case KC_A:
send_unicode_string("Λ ");
case KC_E:
send_unicode_string("Ξ ");
#else
case A:
case E:
tap_code16(S(temp_keycode));
tap_code(KC_SPC);
case KC_B ... KC_D:
case KC_F ... KC_Z:
case KC_1 ... KC_0:
tap_code(temp_keycode);
case KC_BSPC:
tap_code(KC_BSPC);
case KC_SPC:
if (mode.australia) {
// IDEMPOTENT
case KC_L:
case KC_O:
case KC_S:
case KC_Z:
case KC_8:
case KC_0:
tap_code(KC_LEFT);
// INVERSE
case KC_B:
tap_code(KC_Q);
case KC_Q:
tap_code(KC_B);
case KC_D:
tap_code(KC_P);
case KC_P:
tap_code(KC_D);
case KC_N:
tap_code(KC_U);
case KC_U:
tap_code(KC_N);
case KC_6:
tap_code(KC_9);
case KC_9:
tap_code(KC_6);
// TRANSLATE
register_unicode(0x0250); // ɐ
break;
case KC_C:
register_unicode(0x0254); // ɔ
register_unicode(0x01DD); // ǝ
case KC_F:
register_unicode(0x025F); // ɟ
case KC_G:
register_unicode(0x0183); // ƃ
case KC_H:
register_unicode(0x0265); // ɥ
case KC_I:
register_unicode(0x1D09); // ᴉ
case KC_J:
register_unicode(0x027E); // ɾ
case KC_K:
register_unicode(0x029E); // ʞ
case KC_M:
register_unicode(0x026F); // ɯ
case KC_R:
register_unicode(0x0279); // ɹ
case KC_T:
register_unicode(0x0287); // ʇ
case KC_V:
register_unicode(0x028C); // ʌ
case KC_W:
register_unicode(0x028D); // ʍ
case KC_X:
register_unicode(0x2717); // ✗
case KC_Y:
register_unicode(0x028E); // ʎ
case KC_1:
register_unicode(0x0269); // ɩ
case KC_2:
register_unicode(0x3139); // ㄹ
case KC_3:
register_unicode(0x0190); // Ɛ
case KC_4:
register_unicode(0x3123); // ㄣ
case KC_5:
register_unicode(0x03DB); // ϛ
case KC_7:
register_unicode(0x3125); // ㄥ
// CONTROLS
case KC_ENT:
tap_code(KC_END);
tap_code(KC_ENTER);
tap_code(KC_DELT);
switch(keycode) {
case VERSION:
if (!record->event.pressed) {
send_string_with_delay_P(PSTR(QMK_KEYBOARD ":" QMK_KEYMAP "\nVersion:" QMK_VERSION ", built: " QMK_BUILDDATE "\n"), MACRO_TIMER);
case QWERTY ... COLEMAK:
case GREEK ... HIRAGAN:
//set_single_persistent_default_layer(keycode - QWERTY);
default_layer_set(1U << (keycode - QWERTY));
case MAKE:
user_mod_state = get_mods() & MOD_MASK_CTRL;
if (user_mod_state) {
clear_mods();
send_string_with_delay_P(PSTR("sleep 1 && "), MACRO_TIMER);
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER);
send_string_with_delay_P(PSTR(":flash\n"), MACRO_TIMER);
reset_keyboard();
} else {
send_string_with_delay_P(PSTR("\n"), MACRO_TIMER);
case RNGWORD:
if (randword_seed == false) {
randword_seed = true;
srand(timer_read32());
rand_key = rand() % NUMBER_OF_WORDS;
send_string(dict[rand_key]);
case RG_QUOT:
user_mod_state = get_mods() & MOD_MASK_ALT;
unregister_mods(MOD_BIT(KC_RALT));
register_unicode(0x00B0); // °
set_mods(user_mod_state);
user_key_timer = timer_read32();
layer_on(_NUMBER);
register_mods(MOD_BIT(KC_RGUI));
unregister_mods(MOD_BIT(KC_RGUI));
layer_off(_NUMBER);
if (timer_elapsed32(user_key_timer) < TAPPING_TERM) {
tap_code(KC_QUOT);
return false; break;
case TESTING:
int length = snprintf( NULL, 0, "%lu", test_number );
char* str = malloc( length + 1 );
snprintf( str, length + 1, "%lu", test_number );
send_string(str);
free(str);
// make CFLAGS+="-lc -specs=nosys.specs" board:keymap
case CCCV: // One key copy/paste
if (timer_elapsed32(user_key_timer) > TAPPING_TERM) { // Hold, copy
register_code(KC_LCTL);
tap_code(KC_C);
unregister_code(KC_LCTL);
} else { // Tap, paste
tap_code(KC_V);
case SEED:
case SARCASM:
if (!(mode.spongebob ^= 1)) { mode.all = 0U; };
case VPRWAVE:
if (!(mode.aesthetic ^= 1)) { mode.all = 0U; };
case STRAYA:
if (!(mode.australia ^= 1)) { mode.all = 0U; };
default:
if (record->event.pressed && record->event.key.col == 4 && record->event.key.row == 1) {
if (get_mods() & MOD_BIT(KC_RALT)) {
//register_unicode(0x262D); // ☭
set_mods(MOD_BIT(KC_RALT));
return process_record_keymap(keycode, record) &&
process_record_secrets(keycode, record);