]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c
580b041c9cbf67537b43c73af73392f4d362a65e
[qmk_firmware.git] / keyboards / 40percentclub / gherkin / keymaps / itsaferbie / keymap.c
1 #include QMK_KEYBOARD_H
2
3 extern rgblight_config_t rgblight_config;
4 extern keymap_config_t keymap_config;
5
6 #define _PS 0 // This is the Photoshop Layer
7 #define _AI 1 // This is the Illustrator Layer
8 #define _PR 2 // This is the Premier Layer
9 #define _XD 3 // This is the Experience Design Layer
10
11 enum custom_keycodes {
12   PS = SAFE_RANGE,
13   AI,
14   PR,
15 };
16
17 #define _______ KC_TRNS
18
19 #define PS TO(0)
20 #define AI TO(1)
21 #define PR TO(2)
22 #define XD TO(3)
23
24 // Mix of Photoshop, Illustrator, Premiere, and Experience Design shortcuts.
25 #define SAVE  LCTL(KC_S)
26 #define OPEN  LCTL(KC_O)
27 #define COPY  LCTL(KC_C)
28 #define PAST  LCTL(KC_V)
29 #define CUNDO LCTL(LALT(KC_Z))
30 #define INVERT LCTL(LSFT(KC_I))
31 #define NLAYER LSFT(LCTL(KC_N))
32 #define UNDO LCTL(KC_Z)
33 #define TRANS LCTL(KC_T)
34 #define ALIGNL LCTL(LSFT(KC_L))
35 #define ALIGNC LCTL(LSFT(KC_C))
36 #define ALIGNR LCTL(LSFT(KC_R))
37 #define BRINGF LCTL(KC_RBRC)
38 #define BRINGB LCTL(KC_LBRC)
39
40 // Illustrator layer shortcuts.
41 #define SHAPE LSFT(KC_M)
42 #define RULER LCTL(LALT(KC_R))
43
44 // Premiere layer shortcuts.
45 #define REDO LCTL(LSFT(KC_Z))
46 #define EXPORT LCTL(KC_M)
47 #define IMPORT LCTL(KC_I)
48 #define PCOPY LCTL(KC_V)
49 #define PPASTE LCTL(LSFT(KC_V))
50
51 // Experience Design layer shortcuts. (can be used with others too.)
52 #define NEW LCTL(KC_N)
53 #define LOCK LCTL(KC_L)
54 #define SYMB LCTL(KC_K)
55 #define HIDE LCTL(KC_SCLN)
56 #define REPEAT LCTL(KC_R)
57 #define MASK LCTL(LSFT(KC_M))
58 #define GROUP LCTL(KC_G)
59 #define UNGRP LCTL(LSFT(KC_G))
60 #define VIEW LCTL(KC_TAB)
61 #define HORZ LSFT(KC_C)
62 #define VERT LSFT(KC_M)
63
64 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65
66   // Photoshop layer
67   [_PS] = LAYOUT_ortho_3x10(
68     SAVE,    KC_W, KC_E, KC_T,  KC_U,   KC_I,   KC_P,   INVERT,  CUNDO,   NLAYER,
69     UNDO,    KC_H, KC_L, TRANS, ALIGNL, ALIGNC, ALIGNR, BRINGB,  BRINGF,  OPEN,
70     KC_LSFT, COPY, PAST, KC_Z,  KC_C,   KC_V,   KC_B,   KC_LBRC, KC_RBRC, AI
71   ),
72
73   // Illustrator layer
74   [_AI] = LAYOUT_ortho_3x10(
75     _______, M(0),    RULER,   _______, KC_G,    _______, _______, KC_Q,  KC_MINS, KC_PLUS,
76     _______, _______, _______, KC_E,    _______, _______, _______, SHAPE, KC_O,    OPEN,
77     _______, _______, _______, _______, _______, _______, _______, KC_M,  KC_SLSH, PR
78   ),
79
80   // Premiere layer
81   [_PR] = LAYOUT_ortho_3x10(
82     _______, KC_Q,  KC_W,   KC_I,   KC_O, KC_P, IMPORT, EXPORT,  KC_MINS,  KC_EQL,
83     _______, REDO,  KC_D,   KC_F,   KC_H, KC_M, KC_ENT, KC_LBRC, KC_RBRC,  OPEN,
84     _______, PCOPY, PPASTE, KC_SPC, KC_Z, KC_C, KC_V,   KC_LEFT, KC_RIGHT, XD
85   ),
86
87   // Experience Design layer
88   [_XD] = LAYOUT_ortho_3x10(
89     _______, KC_E,    KC_R,  KC_T,  KC_P, KC_A, KC_L, KC_V, KC_DEL, NEW,
90     _______, REDO,    GROUP, UNGRP, VIEW, HORZ, VERT, KC_Z, KC_ENT, OPEN,
91     _______, KC_LCTL, COPY,  PAST,  SYMB, LOCK, MASK, HIDE, REPEAT, PS
92   ),
93
94 };
95
96 void persistent_default_layer_set(uint16_t default_layer) {
97   eeconfig_update_default_layer(default_layer);
98   default_layer_set(default_layer);
99 }
100
101 void matrix_init_user(void) {
102   rgblight_enable();
103 }
104
105 void matrix_scan_user(void) {
106   #ifdef RGBLIGHT_ENABLE
107
108   static uint8_t old_layer = 255;
109   uint8_t new_layer = biton32(layer_state);
110
111   // Color of the Icons.
112   if (old_layer != new_layer) {
113     switch (new_layer) {
114       case _PS:
115         // #31C5F0
116         rgblight_setrgb(49, 197, 240);
117       break;
118       case _AI:
119         // #FF8011
120         rgblight_setrgb(255, 128, 17);
121       break;
122       case _PR:
123         // #E788FF
124         rgblight_setrgb(231, 136, 255);
125       break;
126       case _XD:
127         // #FF2BC2
128         rgblight_setrgb(255, 43, 194);
129       break;
130     }
131     old_layer = new_layer;
132   }
133   #endif
134 }
135
136 const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
137   keyevent_t event = record->event;
138     (void)event;
139
140   switch (id) {
141     case 0:
142       // Save for Web Macro.
143       return MACRO(D(LSFT), D(LALT), D(LCTL), T(S), U(LCTL), U(LALT), U(LSFT), END);
144   }
145   return MACRO_NONE;
146 }
147
148 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
149   switch (keycode) {
150   }
151   return true;
152 }