diff options
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 000000000..106be9b69 --- /dev/null +++ b/users/csc027/csc027.c | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | #include "csc027.h" | ||
| 2 | |||
| 3 | static const char* git_macros[] = { | ||
| 4 | // Make sure that the macro strings match the order they are declared | ||
| 5 | // in the custom_keycodes enum. | ||
| 6 | "git add ", | ||
| 7 | "git branch ", | ||
| 8 | "git checkout ", | ||
| 9 | "git cherry-pick ", | ||
| 10 | "git commit -m \"\""SS_TAP(X_LEFT), | ||
| 11 | "git diff ", | ||
| 12 | "git fetch ", | ||
| 13 | "git grep ", | ||
| 14 | "git log --decorate --oneline --graph ", | ||
| 15 | "git init ", | ||
| 16 | "git mv ", | ||
| 17 | "git merge ", | ||
| 18 | "git push ", | ||
| 19 | "git pull ", | ||
| 20 | "git rebase ", | ||
| 21 | "git remote ", | ||
| 22 | "git reset ", | ||
| 23 | "git show ", | ||
| 24 | "git stash ", | ||
| 25 | "git status ", | ||
| 26 | "git tag ", | ||
| 27 | SS_LCTL(SS_LALT(SS_TAP(X_HOME)))"\t ", | ||
| 28 | SS_LCTL(SS_LALT(SS_TAP(X_HOME)))"\t\t\t ", | ||
| 29 | SS_LCTL(SS_LALT(SS_TAP(X_HOME)))SS_LALT("\t") | ||
| 30 | }; | ||
| 31 | |||
| 32 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 33 | switch(keycode) { | ||
| 34 | case LOWER: | ||
| 35 | if(record->event.pressed) { | ||
| 36 | layer_on(_LW); | ||
| 37 | update_tri_layer(_LW, _RS, _MS); | ||
| 38 | } else { | ||
| 39 | layer_off(_LW); | ||
| 40 | update_tri_layer(_LW, _RS, _MS); | ||
| 41 | } | ||
| 42 | return false; | ||
| 43 | case RAISE: | ||
| 44 | if(record->event.pressed) { | ||
| 45 | layer_on(_RS); | ||
| 46 | update_tri_layer(_LW, _RS, _MS); | ||
| 47 | } else { | ||
| 48 | layer_off(_RS); | ||
| 49 | update_tri_layer(_LW, _RS, _MS); | ||
| 50 | } | ||
| 51 | return false; | ||
| 52 | case GIT_ADD...MC_ATRD: | ||
| 53 | if(record->event.pressed) { | ||
| 54 | // The calculation here is to make sure that the custom keycode | ||
| 55 | // aligns with the git_macros array. | ||
| 56 | send_string(git_macros[keycode - GIT_ADD]); | ||
| 57 | return true; | ||
| 58 | } | ||
| 59 | return false; | ||
| 60 | default: | ||
| 61 | return true; | ||
| 62 | } | ||
| 63 | } | ||
