qmk-firmware/users/csc027/csc027.c
csc027 2c14172467 [Keymap] Added csc027 keymaps for keebio/iris and planck (#7472)
* Added csc027 user folder and keymaps for both keebio/iris and planck

* Moved the git_macros variable out of the process_record_user function.

* Updated the usb_led code to use the new led_update_user instead of the led_set_user function.

* Update users/csc027/defines.h

Removed the "_______" macro definition in defines.h, since it has already been defined in QMK.

* Update users/csc027/defines.h

Removed the "XXXXXXX" macro definition in defines.h, since it has already been defined in QMK.

* Update users/csc027/csc027.c

Simplified several keyboard macro definitions in the csc027.c file by switching from SS_LCTRL to SS_LCTL in their definitions.

* Condensed both the planck and iris rules files to the minimal set of declarations.
2020-01-03 14:12:53 -08:00

64 lines
1.7 KiB
C

#include "csc027.h"
static const char* git_macros[] = {
// Make sure that the macro strings match the order they are declared
// in the custom_keycodes enum.
"git add ",
"git branch ",
"git checkout ",
"git cherry-pick ",
"git commit -m \"\""SS_TAP(X_LEFT),
"git diff ",
"git fetch ",
"git grep ",
"git log --decorate --oneline --graph ",
"git init ",
"git mv ",
"git merge ",
"git push ",
"git pull ",
"git rebase ",
"git remote ",
"git reset ",
"git show ",
"git stash ",
"git status ",
"git tag ",
SS_LCTL(SS_LALT(SS_TAP(X_HOME)))"\t ",
SS_LCTL(SS_LALT(SS_TAP(X_HOME)))"\t\t\t ",
SS_LCTL(SS_LALT(SS_TAP(X_HOME)))SS_LALT("\t")
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case LOWER:
if(record->event.pressed) {
layer_on(_LW);
update_tri_layer(_LW, _RS, _MS);
} else {
layer_off(_LW);
update_tri_layer(_LW, _RS, _MS);
}
return false;
case RAISE:
if(record->event.pressed) {
layer_on(_RS);
update_tri_layer(_LW, _RS, _MS);
} else {
layer_off(_RS);
update_tri_layer(_LW, _RS, _MS);
}
return false;
case GIT_ADD...MC_ATRD:
if(record->event.pressed) {
// The calculation here is to make sure that the custom keycode
// aligns with the git_macros array.
send_string(git_macros[keycode - GIT_ADD]);
return true;
}
return false;
default:
return true;
}
}