QMK SpOngEbob moCKINg TeXT
Alright, if I'm being completely honest with myself I'm not really sure why I made this but I found myself with an extra few moment on the weekend and being a fan of SpongeBob and messing with my friends on the internet, I decided I was getting tired of having to randomly hit shift while typing to make my text look like the SpongeBob mocking text so... being a developer I came up with a solution the only way I know. Bake the functionality into my keyboard firmware obviously.
So for those of you who aren't familiar with QMK
(Quantum Mechanical Keyboard) is an open source firmware developed by the keyboard community. Feel free to check it out here.
So with a quick code and compile I'm happy to share this wonderful little snippet that will let you change your boring old text like this. To morE LIke ThIS! IT shouLD WORK WIth ANY QmK COmpAtIBLE kEYboArd. not ONly DoEs It lOOK SuPER cOOL bUT it ALso hAS tHe ADed bonUS oF mAking evErYtHInG yoU tYPE Sound LikE YoU'rE MOKCinG SomeONE.
// this is the mod mask you wish to use to toggle the "spongebob mocking text"
// mode on or off (in this case I use Left Ctrl + Left Shift + F12) however
// you're free to change this to anything you like.
#define MODS_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LCTRL))
// bool that holds the current state on or off
bool is_sponge_active = false;
// random bool
bool random_bool(void) {
bool rbool = rand() & 1;
return rbool;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_A ... KC_Z: {
if (is_sponge_active && record->event.pressed) {
if (random_bool()) {
register_code(KC_LSHIFT);
}
}
break;
}
case KC_F12:
if ((keyboard_report->mods & MODS_MASK) && record->event.pressed) is_sponge_active = !is_sponge_active;
break;
}
return true;
}
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_A ... KC_Z: {
if (is_sponge_active && record->event.pressed) {
unregister_code(KC_LSHIFT);
}
}
}
}
As you can see from the above code you can customize this to your liking, simply change the MODS_MASK
at the top to whatever you like, or leave it as the default Left Ctrl + Left Shift + F12
.
Enjoy.
Comments
No comments yet. Be the first to comment!
Leave a Comment