2023-04-14 02:42:50 -07:00
|
|
|
#include QMK_KEYBOARD_H
|
2018-11-10 08:22:36 -08:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
static uint16_t keystroke;
|
|
|
|
static bool shift_pressed;
|
|
|
|
|
|
|
|
static int lower = (int) KC_A;
|
|
|
|
static int upper = (int) KC_Z;
|
|
|
|
|
|
|
|
uint16_t random_keycode(void) {
|
|
|
|
return lower + (rand() % (upper - lower + 1));
|
|
|
|
};
|
|
|
|
|
|
|
|
enum custom_keycodes {
|
|
|
|
RND_KEY = SAFE_RANGE
|
|
|
|
};
|
|
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch(keycode) {
|
|
|
|
case RND_KEY:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
keystroke = random_keycode();
|
|
|
|
if (rand() % 2 > 0) {
|
|
|
|
shift_pressed = 1;
|
2022-10-16 06:14:40 -07:00
|
|
|
register_code(KC_LSFT);
|
2018-11-10 08:22:36 -08:00
|
|
|
}
|
|
|
|
register_code(keystroke);
|
|
|
|
} else {
|
|
|
|
if (shift_pressed > 0) {
|
2022-10-16 06:14:40 -07:00
|
|
|
unregister_code(KC_LSFT);
|
2018-11-10 08:22:36 -08:00
|
|
|
}
|
|
|
|
unregister_code(keystroke);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
[0] = LAYOUT( /* Base */
|
2021-12-14 04:41:16 -08:00
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
2022-08-21 15:55:30 -07:00
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, QK_BOOT, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
2021-12-14 04:41:16 -08:00
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY,
|
2018-11-10 08:22:36 -08:00
|
|
|
RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY
|
|
|
|
),
|
|
|
|
};
|