diff options
| author | unknown <itsaferbie@gmail.com> | 2017-09-24 14:04:58 -0400 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2017-09-25 13:15:04 -0400 |
| commit | 169d46ce83f2234216ac218ce588eefd7970b10b (patch) | |
| tree | 639c2154dc90445fdc436c995959da4a34f27801 | |
| parent | 1ad941e98454237d269057d5f68cc1e76ca35dd4 (diff) | |
| download | qmk_firmware-169d46ce83f2234216ac218ce588eefd7970b10b.tar.gz qmk_firmware-169d46ce83f2234216ac218ce588eefd7970b10b.zip | |
Add my gherkin keymap, and update readme and config
| -rw-r--r-- | keyboards/gherkin/README.md | 4 | ||||
| -rw-r--r-- | keyboards/gherkin/config.h | 6 | ||||
| -rw-r--r-- | keyboards/gherkin/keymaps/itsaferbie/config.h | 15 | ||||
| -rw-r--r-- | keyboards/gherkin/keymaps/itsaferbie/keymap.c | 172 | ||||
| -rw-r--r-- | keyboards/gherkin/keymaps/itsaferbie/rules.mk | 7 |
5 files changed, 199 insertions, 5 deletions
diff --git a/keyboards/gherkin/README.md b/keyboards/gherkin/README.md index 74093bbbe..210247af9 100644 --- a/keyboards/gherkin/README.md +++ b/keyboards/gherkin/README.md | |||
| @@ -5,8 +5,8 @@ A 30 key keyboard. | |||
| 5 | 5 | ||
| 6 | * [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gherkin) | 6 | * [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gherkin) |
| 7 | 7 | ||
| 8 | Keyboard Maintainer: QMK Community | 8 | Keyboard Maintainer: QMK Community |
| 9 | Hardware Supported: Gherkin PCB | 9 | Hardware Supported: Gherkin PCB |
| 10 | Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2016/11/gherkin.html) | 10 | Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2016/11/gherkin.html) |
| 11 | 11 | ||
| 12 | Make example for this keyboard (after setting up your build environment): | 12 | Make example for this keyboard (after setting up your build environment): |
diff --git a/keyboards/gherkin/config.h b/keyboards/gherkin/config.h index 27919efbb..4607962d7 100644 --- a/keyboards/gherkin/config.h +++ b/keyboards/gherkin/config.h | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | #define VENDOR_ID 0xFEED | 7 | #define VENDOR_ID 0xFEED |
| 8 | #define PRODUCT_ID 0x6060 | 8 | #define PRODUCT_ID 0x6060 |
| 9 | #define DEVICE_VER 0x0001 | 9 | #define DEVICE_VER 0x0001 |
| 10 | #define MANUFACTURER qmkbuilder | 10 | #define MANUFACTURER 40 Percent Club |
| 11 | #define PRODUCT keyboard | 11 | #define PRODUCT Gherkin |
| 12 | #define DESCRIPTION Keyboard | 12 | #define DESCRIPTION A 30 key ortholinear keyboard |
| 13 | 13 | ||
| 14 | /* key matrix size */ | 14 | /* key matrix size */ |
| 15 | #define MATRIX_ROWS 5 | 15 | #define MATRIX_ROWS 5 |
diff --git a/keyboards/gherkin/keymaps/itsaferbie/config.h b/keyboards/gherkin/keymaps/itsaferbie/config.h new file mode 100644 index 000000000..71c0cb8b5 --- /dev/null +++ b/keyboards/gherkin/keymaps/itsaferbie/config.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef CONFIG_USER_H | ||
| 2 | #define CONFIG_USER_H | ||
| 3 | |||
| 4 | #include "../../config.h" | ||
| 5 | |||
| 6 | #undef RGB_DI_PIN | ||
| 7 | #undef RGBLED_NUM | ||
| 8 | #define RGB_DI_PIN D2 | ||
| 9 | #define RGBLIGHT_ANIMATIONS | ||
| 10 | #define RGBLED_NUM 8 | ||
| 11 | #define RGBLIGHT_HUE_STEP 8 | ||
| 12 | #define RGBLIGHT_SAT_STEP 8 | ||
| 13 | #define RGBLIGHT_VAL_STEP 8 | ||
| 14 | |||
| 15 | #endif \ No newline at end of file | ||
diff --git a/keyboards/gherkin/keymaps/itsaferbie/keymap.c b/keyboards/gherkin/keymaps/itsaferbie/keymap.c new file mode 100644 index 000000000..155689bd3 --- /dev/null +++ b/keyboards/gherkin/keymaps/itsaferbie/keymap.c | |||
| @@ -0,0 +1,172 @@ | |||
| 1 | #include "gherkin.h" | ||
| 2 | #include "action_layer.h" | ||
| 3 | |||
| 4 | extern rgblight_config_t rgblight_config; | ||
| 5 | extern keymap_config_t keymap_config; | ||
| 6 | |||
| 7 | #define _PS 0 // This is the Photoshop Layer | ||
| 8 | #define _AI 1 // This is the Illustrator Layer | ||
| 9 | #define _PR 2 // This is the Premier Layer | ||
| 10 | |||
| 11 | enum custom_keycodes { | ||
| 12 | PS = SAFE_RANGE, | ||
| 13 | AI, | ||
| 14 | PR, | ||
| 15 | }; | ||
| 16 | |||
| 17 | #define PS TO(0) | ||
| 18 | #define AI TO(1) | ||
| 19 | #define PR TO(2) | ||
| 20 | |||
| 21 | // Mix of Photoshop, Illustrator, and Premiere shortcuts. | ||
| 22 | #define SAVE LCTL(KC_S) | ||
| 23 | #define OPEN LCTL(KC_O) | ||
| 24 | #define COPY LCTL(KC_C) | ||
| 25 | #define PAST LCTL(KC_V) | ||
| 26 | #define CUNDO LCTL(LALT(KC_Z)) | ||
| 27 | #define INVERT LCTL(LSFT(KC_I)) | ||
| 28 | #define NLAYER LSFT(LCTL(KC_N)) | ||
| 29 | #define UNDO LCTL(KC_Z) | ||
| 30 | #define TRANS LCTL(KC_T) | ||
| 31 | #define ALIGNL LCTL(LSFT(KC_L)) | ||
| 32 | #define ALIGNC LCTL(LSFT(KC_C)) | ||
| 33 | #define ALIGNR LCTL(LSFT(KC_R)) | ||
| 34 | #define BRINGF LCTL(KC_RBRC) | ||
| 35 | #define BRINGB LCTL(KC_LBRC) | ||
| 36 | |||
| 37 | // Some illustrator only shortcuts. | ||
| 38 | #define SHAPE LSFT(KC_M) | ||
| 39 | #define RULER LCTL(LALT(KC_R)) | ||
| 40 | |||
| 41 | // Premiere only shortcuts. | ||
| 42 | #define REDO LCTL(LSFT(KC_Z)) | ||
| 43 | #define EXPORT LCTL(KC_M) | ||
| 44 | #define IMPORT LCTL(KC_I) | ||
| 45 | #define PCOPY LCTL(KC_V) | ||
| 46 | #define PPASTE LCTL(LSFT(KC_V)) | ||
| 47 | |||
| 48 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 49 | |||
| 50 | // Photoshop layer. | ||
| 51 | [_PS] = KEYMAP( | ||
| 52 | SAVE, KC_W, KC_E, KC_T, KC_U, KC_I, KC_P, INVERT, CUNDO, NLAYER, | ||
| 53 | UNDO, KC_H, KC_L, TRANS, ALIGNL, ALIGNC, ALIGNR, BRINGB, BRINGF, OPEN, | ||
| 54 | KC_LSFT, COPY, PAST, KC_Z, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, AI), | ||
| 55 | |||
| 56 | [_AI] = KEYMAP( | ||
| 57 | KC_TRNS, M(0), RULER, KC_TRNS, KC_G, KC_TRNS, KC_TRNS, KC_Q, KC_MINS, KC_PLUS, | ||
| 58 | KC_TRNS, KC_TRNS, KC_TRNS, KC_E, KC_TRNS, KC_TRNS, KC_TRNS, SHAPE, KC_O, OPEN, | ||
| 59 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_M, KC_SLSH, PR), | ||
| 60 | |||
| 61 | [_PR] = KEYMAP( | ||
| 62 | KC_TRNS, KC_Q, KC_W, KC_I, KC_O, KC_P, IMPORT, EXPORT, KC_MINS, KC_EQL, | ||
| 63 | KC_TRNS, REDO, KC_D, KC_F, KC_H, KC_M, KC_ENT, KC_LBRC, KC_RBRC, OPEN, | ||
| 64 | KC_TRNS, PCOPY, PPASTE, KC_SPC, KC_Z, KC_C, KC_V, KC_LEFT, KC_RIGHT, PS), | ||
| 65 | |||
| 66 | }; | ||
| 67 | |||
| 68 | void persistent_default_layer_set(uint16_t default_layer) { | ||
| 69 | eeconfig_update_default_layer(default_layer); | ||
| 70 | default_layer_set(default_layer); | ||
| 71 | } | ||
| 72 | |||
| 73 | void matrix_init_user(void) { | ||
| 74 | rgblight_enable(); | ||
| 75 | } | ||
| 76 | |||
| 77 | void matrix_scan_user(void) { | ||
| 78 | #ifdef RGBLIGHT_ENABLE | ||
| 79 | |||
| 80 | static uint8_t old_layer = 255; | ||
| 81 | uint8_t new_layer = biton32(layer_state); | ||
| 82 | |||
| 83 | // Color of the Icons. | ||
| 84 | if (old_layer != new_layer) { | ||
| 85 | switch (new_layer) { | ||
| 86 | case _PS: | ||
| 87 | rgblight_setrgb(49, 197, 240); | ||
| 88 | break; | ||
| 89 | case _AI: | ||
| 90 | rgblight_setrgb(255, 128, 17); | ||
| 91 | break; | ||
| 92 | case _PR: | ||
| 93 | rgblight_setrgb(231, 136, 255); | ||
| 94 | break; | ||
| 95 | } | ||
| 96 | old_layer = new_layer; | ||
| 97 | } | ||
| 98 | #endif | ||
| 99 | } | ||
| 100 | |||
| 101 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { | ||
| 102 | keyevent_t event = record->event; | ||
| 103 | (void)event; | ||
| 104 | |||
| 105 | switch (id) { | ||
| 106 | case 0: | ||
| 107 | // Save for Web Macro. | ||
| 108 | return MACRO(D(LSFT), D(LALT), D(LCTL), T(S), U(LCTL), U(LALT), U(LSFT), END); | ||
| 109 | } | ||
| 110 | return MACRO_NONE; | ||
| 111 | } | ||
| 112 | |||
| 113 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 114 | switch (keycode) { | ||
| 115 | // case PS: | ||
| 116 | // if (record->event.pressed) { | ||
| 117 | // layer_on(_PS); | ||
| 118 | |||
| 119 | // RGB_current_mode = rgblight_config.mode; | ||
| 120 | // RGB_current_hue = rgblight_config.hue; | ||
| 121 | |||
| 122 | // rgblight_mode(1); | ||
| 123 | // rgblight_setrgb(0,0,255); | ||
| 124 | // } | ||
| 125 | // // else { | ||
| 126 | // // layer_off(_PS); | ||
| 127 | |||
| 128 | // // rgblight_mode(RGB_current_mode); | ||
| 129 | // // rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); | ||
| 130 | // // } | ||
| 131 | // return false; | ||
| 132 | // break; | ||
| 133 | // case AI: | ||
| 134 | // if (record->event.pressed) { | ||
| 135 | // layer_on(_AI); | ||
| 136 | |||
| 137 | // RGB_current_mode = rgblight_config.mode; | ||
| 138 | // RGB_current_hue = rgblight_config.hue; | ||
| 139 | |||
| 140 | // // Set to orange. | ||
| 141 | // rgblight_mode(1); | ||
| 142 | // rgblight_setrgb(255, 0, 0); | ||
| 143 | // } | ||
| 144 | // // else { | ||
| 145 | // // layer_off(_AI); | ||
| 146 | |||
| 147 | // // rgblight_mode(RGB_current_mode); | ||
| 148 | // // rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); | ||
| 149 | // // } | ||
| 150 | // return false; | ||
| 151 | // break; | ||
| 152 | // case PR: | ||
| 153 | // if (record->event.pressed) { | ||
| 154 | // layer_on(_PR); | ||
| 155 | |||
| 156 | // RGB_current_mode = rgblight_config.mode; | ||
| 157 | // RGB_current_hue = rgblight_config.hue; | ||
| 158 | |||
| 159 | // // Set to purple. | ||
| 160 | // rgblight_mode(1); | ||
| 161 | // rgblight_setrgb(0, 255, 0); | ||
| 162 | // } else { | ||
| 163 | // layer_off(_PR); | ||
| 164 | |||
| 165 | // rgblight_mode(RGB_current_mode); | ||
| 166 | // rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val); | ||
| 167 | // } | ||
| 168 | // return false; | ||
| 169 | // break; | ||
| 170 | } | ||
| 171 | return true; | ||
| 172 | } | ||
diff --git a/keyboards/gherkin/keymaps/itsaferbie/rules.mk b/keyboards/gherkin/keymaps/itsaferbie/rules.mk new file mode 100644 index 000000000..ed0af7b8b --- /dev/null +++ b/keyboards/gherkin/keymaps/itsaferbie/rules.mk | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | BACKLIGHT_ENABLE = yes | ||
| 2 | AUDIO_ENABLE = no | ||
| 3 | RGBLIGHT_ENABLE = yes | ||
| 4 | |||
| 5 | ifndef QUANTUM_DIR | ||
| 6 | include ../../../../Makefile | ||
| 7 | endif \ No newline at end of file | ||
