diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2016-08-14 18:50:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-14 18:50:22 -0400 |
| commit | 4865e6f81fc106b9765b8dee2a080f4015e7644a (patch) | |
| tree | 1123c709e4fb84a11e7f4163510eb5d19305f2b5 | |
| parent | cdd7301b8b9c6750167e29a878ec0f1582226f5d (diff) | |
| parent | 54e37fd2d10f91b1b77cee263c1e3a2b3552cbd9 (diff) | |
| download | qmk_firmware-4865e6f81fc106b9765b8dee2a080f4015e7644a.tar.gz qmk_firmware-4865e6f81fc106b9765b8dee2a080f4015e7644a.zip | |
Merge pull request #631 from jacwib/master
Jacwib's keymap
| -rw-r--r-- | keyboards/preonic/keymaps/jacwib/Makefile | 20 | ||||
| -rw-r--r-- | keyboards/preonic/keymaps/jacwib/config.h | 8 | ||||
| -rw-r--r-- | keyboards/preonic/keymaps/jacwib/keymap.c | 215 | ||||
| -rw-r--r-- | keyboards/preonic/keymaps/jacwib/readme.md | 3 |
4 files changed, 246 insertions, 0 deletions
diff --git a/keyboards/preonic/keymaps/jacwib/Makefile b/keyboards/preonic/keymaps/jacwib/Makefile new file mode 100644 index 000000000..3e87d41d3 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/Makefile | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | |||
| 2 | |||
| 3 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 4 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 5 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 6 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 7 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
| 8 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 9 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 10 | MIDI_ENABLE = no # MIDI controls | ||
| 11 | AUDIO_ENABLE = yes # Audio output on port C6 | ||
| 12 | UNICODE_ENABLE = no # Unicode | ||
| 13 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 14 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. | ||
| 15 | |||
| 16 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 17 | |||
| 18 | ifndef QUANTUM_DIR | ||
| 19 | include ../../../../Makefile | ||
| 20 | endif | ||
diff --git a/keyboards/preonic/keymaps/jacwib/config.h b/keyboards/preonic/keymaps/jacwib/config.h new file mode 100644 index 000000000..23e9e0ed2 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/config.h | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | #ifndef CONFIG_USER_H | ||
| 2 | #define CONFIG_USER_H | ||
| 3 | |||
| 4 | #include "../../config.h" | ||
| 5 | |||
| 6 | #define FORCE_NKRO 1 | ||
| 7 | |||
| 8 | #endif | ||
diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c new file mode 100644 index 000000000..cf441bf30 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/keymap.c | |||
| @@ -0,0 +1,215 @@ | |||
| 1 | #include "preonic.h" | ||
| 2 | #include "action_layer.h" | ||
| 3 | #include "eeconfig.h" | ||
| 4 | #include "keymap_nordic.h" | ||
| 5 | #ifdef AUDIO_ENABLE | ||
| 6 | #include "audio.h" | ||
| 7 | #endif | ||
| 8 | |||
| 9 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 10 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 11 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 12 | // entirely and just use numbers. | ||
| 13 | #define _QWERTY 0 | ||
| 14 | #define _LOWER 3 | ||
| 15 | #define _RAISE 4 | ||
| 16 | #define _ADJUST 16 | ||
| 17 | |||
| 18 | enum preonic_keycodes { | ||
| 19 | QWERTY = SAFE_RANGE, | ||
| 20 | LOWER, | ||
| 21 | RAISE, | ||
| 22 | BACKLIT | ||
| 23 | }; | ||
| 24 | |||
| 25 | // Fillers to make layering more clear | ||
| 26 | #define _______ KC_TRNS | ||
| 27 | #define XXXXXXX KC_NO | ||
| 28 | |||
| 29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 30 | |||
| 31 | /* Qwerty | ||
| 32 | * ,-----------------------------------------------------------------------------------. | ||
| 33 | * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | Bksp | | ||
| 34 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 35 | * | Esc | Q | W | E | R | T | Y | U | I | O | P | Å | | ||
| 36 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 37 | * | Tab | A | S | D | F | G | H | J | K | L | Ö | Ä | | ||
| 38 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 39 | * | Shift| < | Z | X | C | V | B | N | M | . | , | - | | ||
| 40 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 41 | * | Ctrl | GUI | Alt |AltGr |Lower | Space| Enter|Raise | Left | Down | Up |Right | | ||
| 42 | * `-----------------------------------------------------------------------------------' | ||
| 43 | */ | ||
| 44 | [_QWERTY] = { | ||
| 45 | {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_BSPC}, | ||
| 46 | {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM }, | ||
| 47 | {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH}, | ||
| 48 | {KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS}, | ||
| 49 | {KC_LCTL, KC_LGUI, KC_LALT, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} | ||
| 50 | }, | ||
| 51 | |||
| 52 | /* Lower | ||
| 53 | * ,-----------------------------------------------------------------------------------. | ||
| 54 | * | | @ | £ | $ | | | { | [ | ] | } | \ | Del | | ||
| 55 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 56 | * | | | | | | | | |VolUp | | | ~ | | ||
| 57 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 58 | * | | | | | | | |LastS |PauseP|NextS | | * | | ||
| 59 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 60 | * | | | | | | | | | |VolDwn| | | | | ||
| 61 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 62 | * | | | | | | |Bspc | | | | | | | ||
| 63 | * `-----------------------------------------------------------------------------------' | ||
| 64 | */ | ||
| 65 | [_LOWER] = { | ||
| 66 | {_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL}, | ||
| 67 | {_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD}, | ||
| 68 | {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, LSFT(KC_BSLS)}, | ||
| 69 | {_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______}, | ||
| 70 | {_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______} | ||
| 71 | }, | ||
| 72 | |||
| 73 | /* Raise | ||
| 74 | * ,-----------------------------------------------------------------------------------. | ||
| 75 | * | ! | " | # | ¤ | % | & | / | ( | ) | = | ? | Ins | | ||
| 76 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 77 | * | | | |Mouse^| | | | |ScrlUp| | | ^ | | ||
| 78 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 79 | * | | |Mouse<|MouseV|Mouse>| | |MLC |MMC |MRC | ' | " | | ||
| 80 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 81 | * | | > | | | | | | |ScrlDown| : | ; | _ | | ||
| 82 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 83 | * | | | | | |Bspc | | | | | | | | ||
| 84 | * `-----------------------------------------------------------------------------------' | ||
| 85 | */ | ||
| 86 | [_RAISE] = { | ||
| 87 | {LSFT(KC_1),NO_QUO2,LSFT(KC_3), NO_BULT,LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL, NO_QUES, KC_INS}, | ||
| 88 | {_______, _______, _______, KC_MS_U, _______, _______, _______, _______, KC_WH_U, _______, _______, NO_CIRC}, | ||
| 89 | {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, NO_APOS, NO_QUOT}, | ||
| 90 | {_______, NO_GRTR, _______, _______, _______, _______, _______, _______, KC_WH_D, NO_COLN, NO_SCLN, NO_UNDS}, | ||
| 91 | {_______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______} | ||
| 92 | }, | ||
| 93 | |||
| 94 | /* Adjust (Lower + Raise) | ||
| 95 | * ,-----------------------------------------------------------------------------------. | ||
| 96 | * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | ||
| 97 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 98 | * | | | | Reset| | | | | | | | | | ||
| 99 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 100 | * | | | | | | | | | | | |Rsft | | ||
| 101 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 102 | * | |MusOn |MusOff| | | | | | | | | Reset| | ||
| 103 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 104 | * | | | | | | | | | | | | | ||
| 105 | * `-----------------------------------------------------------------------------------' | ||
| 106 | */ | ||
| 107 | [_ADJUST] = { | ||
| 108 | {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, | ||
| 109 | {_______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______}, | ||
| 110 | {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT}, | ||
| 111 | {_______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, RESET }, | ||
| 112 | {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} | ||
| 113 | } | ||
| 114 | |||
| 115 | |||
| 116 | }; | ||
| 117 | |||
| 118 | #ifdef AUDIO_ENABLE | ||
| 119 | float tone_startup[][2] = { | ||
| 120 | {NOTE_B5, 20}, | ||
| 121 | {NOTE_B6, 8}, | ||
| 122 | {NOTE_DS6, 20}, | ||
| 123 | {NOTE_B6, 8} | ||
| 124 | }; | ||
| 125 | |||
| 126 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 127 | |||
| 128 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | ||
| 129 | |||
| 130 | float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); | ||
| 131 | #endif | ||
| 132 | |||
| 133 | void persistant_default_layer_set(uint16_t default_layer) { | ||
| 134 | eeconfig_update_default_layer(default_layer); | ||
| 135 | default_layer_set(default_layer); | ||
| 136 | } | ||
| 137 | |||
| 138 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 139 | switch (keycode) { | ||
| 140 | case QWERTY: | ||
| 141 | if (record->event.pressed) { | ||
| 142 | #ifdef AUDIO_ENABLE | ||
| 143 | PLAY_NOTE_ARRAY(tone_qwerty, false, 0); | ||
| 144 | #endif | ||
| 145 | persistant_default_layer_set(1UL<<_QWERTY); | ||
| 146 | } | ||
| 147 | return false; | ||
| 148 | break; | ||
| 149 | case LOWER: | ||
| 150 | if (record->event.pressed) { | ||
| 151 | layer_on(_LOWER); | ||
| 152 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 153 | } else { | ||
| 154 | layer_off(_LOWER); | ||
| 155 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 156 | } | ||
| 157 | return false; | ||
| 158 | break; | ||
| 159 | case RAISE: | ||
| 160 | if (record->event.pressed) { | ||
| 161 | layer_on(_RAISE); | ||
| 162 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 163 | } else { | ||
| 164 | layer_off(_RAISE); | ||
| 165 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
| 166 | } | ||
| 167 | return false; | ||
| 168 | break; | ||
| 169 | case BACKLIT: | ||
| 170 | if (record->event.pressed) { | ||
| 171 | register_code(KC_RSFT); | ||
| 172 | #ifdef BACKLIGHT_ENABLE | ||
| 173 | backlight_step(); | ||
| 174 | #endif | ||
| 175 | } else { | ||
| 176 | unregister_code(KC_RSFT); | ||
| 177 | } | ||
| 178 | return false; | ||
| 179 | break; | ||
| 180 | } | ||
| 181 | return true; | ||
| 182 | }; | ||
| 183 | |||
| 184 | void matrix_init_user(void) { | ||
| 185 | #ifdef AUDIO_ENABLE | ||
| 186 | startup_user(); | ||
| 187 | #endif | ||
| 188 | } | ||
| 189 | |||
| 190 | #ifdef AUDIO_ENABLE | ||
| 191 | |||
| 192 | void startup_user() | ||
| 193 | { | ||
| 194 | _delay_ms(20); // gets rid of tick | ||
| 195 | PLAY_NOTE_ARRAY(tone_startup, false, 0); | ||
| 196 | } | ||
| 197 | |||
| 198 | void shutdown_user() | ||
| 199 | { | ||
| 200 | PLAY_NOTE_ARRAY(tone_goodbye, false, 0); | ||
| 201 | _delay_ms(150); | ||
| 202 | stop_all_notes(); | ||
| 203 | } | ||
| 204 | |||
| 205 | void music_on_user(void) | ||
| 206 | { | ||
| 207 | music_scale_user(); | ||
| 208 | } | ||
| 209 | |||
| 210 | void music_scale_user(void) | ||
| 211 | { | ||
| 212 | PLAY_NOTE_ARRAY(music_scale, false, 0); | ||
| 213 | } | ||
| 214 | |||
| 215 | #endif | ||
diff --git a/keyboards/preonic/keymaps/jacwib/readme.md b/keyboards/preonic/keymaps/jacwib/readme.md new file mode 100644 index 000000000..066031235 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # Jacwib's preonic keymap. | ||
| 2 | |||
| 3 | Designed for use with a swedish language. | ||
