diff options
author | csc027 <csc_dev@protonmail.com> | 2020-01-03 14:12:53 -0800 |
---|---|---|
committer | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-01-03 14:12:53 -0800 |
commit | 2c1417246789383829145bdfc51b3b3921a99341 (patch) | |
tree | 8f82242bea0b93e193fab936399aea5409b8a882 /users/csc027/csc027.c | |
parent | 320822d75b785401809f45007320e6fb6885b3fd (diff) |
[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.
Diffstat (limited to 'users/csc027/csc027.c')
-rw-r--r-- | users/csc027/csc027.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/users/csc027/csc027.c b/users/csc027/csc027.c new file mode 100644 index 0000000000..106be9b690 --- /dev/null +++ b/users/csc027/csc027.c @@ -0,0 +1,63 @@ +#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; + } +} |