aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-05-24 13:59:30 -0400
committerGitHub <noreply@github.com>2017-05-24 13:59:30 -0400
commit7a4ec3bd926865e490fbf7c5ec68d762e998683f (patch)
treeec50b19b9031b1f3f24e003879f95cf9690d61af
parentad420e7205bb2483348056d6b77adb837010ad5a (diff)
parent006ba4bf36e026d6b6c91ef52a5d0e32c7eefe34 (diff)
downloadqmk_firmware-7a4ec3bd926865e490fbf7c5ec68d762e998683f.tar.gz
qmk_firmware-7a4ec3bd926865e490fbf7c5ec68d762e998683f.zip
Merge pull request #1316 from nikchi/master
FrostyFlake Keymap
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/Makefile23
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/config.h24
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/keymap.c224
-rw-r--r--keyboards/frosty_flake/keymaps/nikchi/readme.md24
-rw-r--r--keyboards/frosty_flake/rules.mk4
-rw-r--r--keyboards/preonic/keymaps/nikchi/Makefile3
-rw-r--r--keyboards/preonic/keymaps/nikchi/config.h29
-rw-r--r--keyboards/preonic/keymaps/nikchi/keymap.c221
-rw-r--r--keyboards/preonic/keymaps/nikchi/readme.md1
-rw-r--r--quantum/process_keycode/process_unicodemap.c2
10 files changed, 552 insertions, 3 deletions
diff --git a/keyboards/frosty_flake/keymaps/nikchi/Makefile b/keyboards/frosty_flake/keymaps/nikchi/Makefile
new file mode 100644
index 000000000..ad86e82d2
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/Makefile
@@ -0,0 +1,23 @@
1# Build Options
2# change to "no" to disable the options, or define them in the Makefile in
3# the appropriate keymap folder that will get included automatically
4#
5BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
6MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
7EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
8CONSOLE_ENABLE = no # Console for debug(+400)
9COMMAND_ENABLE = no # Commands for debug and configuration
10NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
11BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
12MIDI_ENABLE = no # MIDI controls
13AUDIO_ENABLE = no # Audio output on port C6
14UNICODE_ENABLE = no # Unicode
15UNICODEMAP_ENABLE = yes # unicodemap
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
18SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
19TAP_DANCE_ENABLE = yes
20
21ifndef QUANTUM_DIR
22 include ../../../../Makefile
23endif
diff --git a/keyboards/frosty_flake/keymaps/nikchi/config.h b/keyboards/frosty_flake/keymaps/nikchi/config.h
new file mode 100644
index 000000000..e91d082c8
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/config.h
@@ -0,0 +1,24 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define TAPPING_TERM 300
7#define LEADER_TIMEOUT 400
8
9#define DISABLE_SPACE_CADET_ROLLOVER
10
11#define UNICODE_TYPE_DELAY 0
12
13#define LSPO_KEY KC_9
14#define RSPC_KEY KC_0
15
16#define MOUSEKEY_INTERVAL 20
17#define MOUSEKEY_DELAY 0
18#define MOUSEKEY_TIME_TO_MAX 60
19#define MOUSEKEY_MAX_SPEED 7
20#define MOUSEKEY_WHEEL_DELAY 0
21// place overrides here
22
23#endif
24
diff --git a/keyboards/frosty_flake/keymaps/nikchi/keymap.c b/keyboards/frosty_flake/keymaps/nikchi/keymap.c
new file mode 100644
index 000000000..c9e220721
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/keymap.c
@@ -0,0 +1,224 @@
1#include "frosty_flake.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4#include "process_unicode.h"
5#include "process_unicodemap.h"
6#include "quantum.h"
7
8#define _______ KC_TRNS
9
10
11//declarations for tap dancing emojis
12void register_hex32(uint32_t hex);
13void cycleEmojis(qk_tap_dance_state_t *state, void *user_data);
14void cycleAnimals(qk_tap_dance_state_t *state, void *user_data);
15void cycleHands(qk_tap_dance_state_t *state, void *user_data);
16
17void tap(uint16_t keycode){
18 register_code(keycode);
19 unregister_code(keycode);
20};
21
22//Tap Dance Declarations
23enum taps{
24 TD_CTCPS = 0,
25 EMOJIS,
26 ANIMAL,
27 HAND
28};
29
30enum unicode_name { // split every five emojis
31 THINK = 1, // thinking face 🤔
32 GRIN, // grinning face 😊
33 SMRK, // smirk 😏
34 WEARY, // good shit 😩
35 UNAMU, // unamused 😒
36
37 SNEK, // snke 🐍
38 PENGUIN, // 🐧
39 DRAGON, // 🐉
40 MONKEY, // 🐒
41 CHICK, // 🐥
42
43 OKOK, // 👌
44 EFFU, // 🖕
45 INUP, // 👆
46 THUP, // 👍
47 THDN, // 👎
48
49 BBB, // dat B 🅱
50 POO, // poop 💩
51 HUNDR, // 100 💯
52 EGGPL, // EGGPLANT 🍆
53 WATER, // wet 💦
54
55 LIT // fire 🔥
56
57};
58
59enum my_macros {
60 NEWDESK = 0,
61 LEFTDESK,
62 RIGHTDESK,
63 CLOSEDESK
64};
65enum quick {
66 DISFACE = 0,
67 TFLIP,
68 TPUT,
69 SHRUG,
70 FACE,
71 RANDIG
72};
73
74// Tap Dance Definitions
75qk_tap_dance_action_t tap_dance_actions[] = {
76 // Tap once for CTRL, twice for Caps Lock
77 [TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
78 [EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL),
79 [ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL),
80 [HAND] = ACTION_TAP_DANCE_FN_ADVANCED(cycleHands, NULL, NULL)
81// Other declarations would go here, separated by commas, if you have them
82};
83
84// macros
85const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
86 switch(id) {
87 case NEWDESK: // this would trigger when you hit a key mapped as M(0)
88 if (record->event.pressed) {
89 return MACRO( I(1), D(LGUI), D(LCTL), D(D), U(LGUI), U(LCTL), U(D), END ); // NEW DESKTOP
90 }
91 break;
92 case LEFTDESK: // this would trigger when you hit a key mapped as M(0)
93 if (record->event.pressed) {
94 return MACRO( I(1), D(LGUI), D(LCTL), D(LEFT), U(LGUI), U(LCTL), U(LEFT), END ); // LEFT DESKTOP
95 }
96 break;
97 case RIGHTDESK: // this would trigger when you hit a key mapped as M(0)
98 if (record->event.pressed) {
99 return MACRO( I(1), D(LGUI), D(LCTL), D(RGHT), U(LGUI), U(LCTL), U(RGHT), END ); // RIGHT DESKTOP
100 }
101 break;
102 case CLOSEDESK: // this would trigger when you hit a key mapped as M(0)
103 if (record->event.pressed) {
104 return MACRO( I(1), D(LGUI), D(LCTL), D(F4), U(LGUI), U(LCTL), U(F4), END ); // CLOSE DESKTOP
105 }
106 break;
107 }
108 return MACRO_NONE;
109};
110
111// emojis in unicode
112const uint32_t PROGMEM unicode_map[] = {
113 [THINK] = 0x1F914,
114 [GRIN] = 0x1F600,
115 [BBB] = 0x1F171,
116 [POO] = 0x1F4A9,
117 [HUNDR] = 0x1F4AF,
118 [SMRK] = 0x1F60F,
119 [WEARY] = 0x1F629,
120 [EGGPL] = 0x1F346,
121 [WATER] = 0x1F4A6,
122 [LIT] = 0x1F525,
123 [UNAMU] = 0x1F612,
124 [SNEK] = 0x1F40D,
125 [PENGUIN] = 0x1F427,
126 [MONKEY] = 0x1F412,
127 [CHICK] = 0x1F425,
128 [DRAGON] = 0x1F409,
129 [OKOK] = 0x1F44C,
130 [EFFU] = 0x1F595,
131 [INUP] = 0x1F446,
132 [THDN] = 0x1F44E,
133 [THUP] = 0x1F44D
134 };
135// Layouts
136const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
137[0] = KEYMAP(\
138 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
139 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS,KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
140 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL, KC_END,KC_PGDN, KC_P7, KC_P8, KC_P9,KC_PPLS, \
141 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \
142 KC_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \
143 TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT),
144[1] = KEYMAP(\
145 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
146 TD(EMOJIS),TD(ANIMAL),TD(HAND),X(SMRK),X(WEARY),X(UNAMU), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
147 KC_TAB, KC_Q, M(0), KC_E, KC_R,X(EGGPL),X(WATER), KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
148 KC_LCTL, M(1), M(3), M(2), KC_F, X(LIT), X(SNEK), KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \
149 KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, X(HUNDR), X(BBB), X(POO), KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
150 KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT),
151[2] = KEYMAP(\
152 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
153 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \
154 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \
155 KC_LCTL, KC_D, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, \
156 KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \
157 KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, _______, _______, KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT),
158};
159
160LEADER_EXTERNS();
161
162void matrix_scan_user(void) {
163 LEADER_DICTIONARY() {
164 leading = false;
165 leader_end();
166
167 SEQ_TWO_KEYS(KC_A, KC_A) { // select all and copy
168 register_code(KC_LCTL);
169 tap(KC_A);
170 tap(KC_C);
171 unregister_code(KC_LCTL);
172 }
173
174 }
175}
176
177void matrix_init_user(void) {
178 _delay_ms(500);
179 set_unicode_input_mode(UC_WINC);
180};
181
182
183void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) {
184 if(state->count == 1) {
185 unicode_input_start();
186 register_hex32(pgm_read_dword(&unicode_map[state->count]));
187 unicode_input_finish();
188 }
189 else if(state->count <= 5) {
190 tap(KC_BSPC);
191 unicode_input_start();
192 register_hex32(pgm_read_dword(&unicode_map[state->count]));
193 unicode_input_finish();
194 }
195};
196
197void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) {
198 if(state->count == 1) {
199 unicode_input_start();
200 register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
201 unicode_input_finish();
202 }
203 else if(state->count <= 5) {
204 tap(KC_BSPC);
205 unicode_input_start();
206 register_hex32(pgm_read_dword(&unicode_map[state->count+5]));
207 unicode_input_finish();
208 }
209};
210
211void cycleHands(qk_tap_dance_state_t *state, void *user_data) {
212 if(state->count == 1) {
213 unicode_input_start();
214 register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
215 unicode_input_finish();
216 }
217 else if(state->count <= 5) {
218 tap(KC_BSPC);
219 unicode_input_start();
220 register_hex32(pgm_read_dword(&unicode_map[state->count+10]));
221 unicode_input_finish();
222 }
223};
224
diff --git a/keyboards/frosty_flake/keymaps/nikchi/readme.md b/keyboards/frosty_flake/keymaps/nikchi/readme.md
new file mode 100644
index 000000000..0b01f9dbf
--- /dev/null
+++ b/keyboards/frosty_flake/keymaps/nikchi/readme.md
@@ -0,0 +1,24 @@
1# The Nikchi's keymap for frosty_flake
2
3### FEATURING
4-SPACE CADET
5-Caps Lock is now LCTRL
6-LCTRL is Tap(LCTRL, Caps Lock)
7
8### LEADER KEY - RALT
9COMBOS
10-a,a => Select All, Copy
11
12
13
14### FN REBINDS for Windows
15```
16 [W] [New Desktop]
17[A][S][D] [Left Desk][Delete Desk][Right Desk]
18
19[Ins][Hom][PUp] [RW][PP][FF]
20[Del][End][PDn] [MU][VD][VU]
21
22Arrows are Mouskeys, left three mods are clicks
23
24``` \ No newline at end of file
diff --git a/keyboards/frosty_flake/rules.mk b/keyboards/frosty_flake/rules.mk
index dd2f4b6ee..f878533fe 100644
--- a/keyboards/frosty_flake/rules.mk
+++ b/keyboards/frosty_flake/rules.mk
@@ -54,8 +54,8 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) 54BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) 55MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) 56EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
57CONSOLE_ENABLE ?= yes # Console for debug(+400) 57CONSOLE_ENABLE ?= no # Console for debug(+400)
58COMMAND_ENABLE ?= yes # Commands for debug and configuration 58COMMAND_ENABLE ?= no # Commands for debug and configuration
59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend 60SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
diff --git a/keyboards/preonic/keymaps/nikchi/Makefile b/keyboards/preonic/keymaps/nikchi/Makefile
new file mode 100644
index 000000000..3d4659ceb
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/Makefile
@@ -0,0 +1,3 @@
1ifndef QUANTUM_DIR
2 include ../../../../Makefile
3endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/nikchi/config.h b/keyboards/preonic/keymaps/nikchi/config.h
new file mode 100644
index 000000000..4c6158199
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/config.h
@@ -0,0 +1,29 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6/*
7 * MIDI options
8 */
9
10/* Prevent use of disabled MIDI features in the keymap */
11//#define MIDI_ENABLE_STRICT 1
12
13/* enable basic MIDI features:
14 - MIDI notes can be sent when in Music mode is on
15*/
16#define MIDI_BASIC
17
18/* enable advanced MIDI features:
19 - MIDI notes can be added to the keymap
20 - Octave shift and transpose
21 - Virtual sustain, portamento, and modulation wheel
22 - etc.
23*/
24//#define MIDI_ADVANCED
25
26/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
27//#define MIDI_TONE_KEYCODE_OCTAVES 2
28
29#endif \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/nikchi/keymap.c b/keyboards/preonic/keymaps/nikchi/keymap.c
new file mode 100644
index 000000000..249dd1e64
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/keymap.c
@@ -0,0 +1,221 @@
1#include "preonic.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4#ifdef AUDIO_ENABLE
5 #include "audio.h"
6#endif
7
8// Each layer gets a name for readability, which is then used in the keymap matrix below.
9// The underscores don't mean anything - you can have a layer called STUFF or any other name.
10// Layer names don't all need to be of the same length, obviously, and you can also skip them
11// entirely and just use numbers.
12
13enum preonic_layers {
14 _QWERTY,
15 _COLEMAK,
16 _DVORAK,
17 _LOWER,
18 _RAISE,
19 _ADJUST
20};
21
22enum preonic_keycodes {
23 QWERTY = SAFE_RANGE,
24 LOWER,
25 RAISE,
26 BACKLIT
27};
28
29// Fillers to make layering more clear
30#define _______ KC_TRNS
31#define XXXXXXX KC_NO
32
33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34
35/* Qwerty
36 * ,-----------------------------------------------------------------------------------.
37 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
38 * |------+------+------+------+------+------+------+------+------+------+------+------|
39 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
40 * |------+------+------+------+------+-------------+------+------+------+------+------|
41 * | CTRL | A | S | D | F | G | H | J | K | L | ; | " |
42 * |------+------+------+------+------+------|------+------+------+------+------+------|
43 * | Lower| Z | X | C | V | B | N | M | , | . | / |Raise |
44 * |------+------+------+------+------+------+------+------+------+------+------+------|
45 * | Brite| Ctrl | Alt | GUI |BKSP |SHIFT |ENTER |SPC | Left | Down | Up |Right |
46 * `-----------------------------------------------------------------------------------'
47 */
48[_QWERTY] = {
49 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
50 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL},
51 {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
52 {LOWER , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RAISE },
53 {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, KC_LSFT, KC_ENT, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
54},
55
56/* Lower
57 * ,-----------------------------------------------------------------------------------.
58 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
59 * |------+------+------+------+------+-------------+------+------+------+------+------|
60 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
61 * |------+------+------+------+------+-------------+------+------+------+------+------|
62 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
63 * |------+------+------+------+------+------|------+------+------+------+------+------|
64 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | |
65 * |------+------+------+------+------+------+------+------+------+------+------+------|
66 * | | | | | | | | Next | Vol- | Vol+ | Play |
67 * `-----------------------------------------------------------------------------------'
68 */
69[_LOWER] = {
70 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
71 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL},
72 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
73 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
74 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
75},
76
77/* Raise
78 * ,-----------------------------------------------------------------------------------.
79 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
80 * |------+------+------+------+------+------+------+------+------+------+------+------|
81 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
82 * |------+------+------+------+------+-------------+------+------+------+------+------|
83 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
84 * |------+------+------+------+------+------|------+------+------+------+------+------|
85 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | | | | | | | | Next | Vol- | Vol+ | Play |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_RAISE] = {
91 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
92 {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL},
93 {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
94 {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______},
95 {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
96},
97
98/* Adjust (Lower + Raise)
99 * ,-----------------------------------------------------------------------------------.
100 * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
101 * |------+------+------+------+------+------+------+------+------+------+------+------|
102 * | | Reset| | | | | | | | | | Del |
103 * |------+------+------+------+------+-------------+------+------+------+------+------|
104 * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
105 * |------+------+------+------+------+------|------+------+------+------+------+------|
106 * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
107 * |------+------+------+------+------+------+------+------+------+------+------+------|
108 * | | | | | | | | | | | |
109 * `-----------------------------------------------------------------------------------'
110 */
111[_ADJUST] = {
112 {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},
113 {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
114 {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______},
115 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
116 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
117}
118
119
120};
121
122#ifdef AUDIO_ENABLE
123float tone_startup[][2] = {
124 {NOTE_B5, 20},
125 {NOTE_B6, 8},
126 {NOTE_DS6, 20},
127 {NOTE_B6, 8}
128};
129
130float tone_qwerty[][2] = SONG(QWERTY_SOUND);
131float tone_dvorak[][2] = SONG(DVORAK_SOUND);
132float tone_colemak[][2] = SONG(COLEMAK_SOUND);
133
134float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
135
136float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
137#endif
138
139void persistent_default_layer_set(uint16_t default_layer) {
140 eeconfig_update_default_layer(default_layer);
141 default_layer_set(default_layer);
142}
143
144bool process_record_user(uint16_t keycode, keyrecord_t *record) {
145 switch (keycode) {
146 case QWERTY:
147 if (record->event.pressed) {
148 #ifdef AUDIO_ENABLE
149 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
150 #endif
151 persistent_default_layer_set(1UL<<_QWERTY);
152 }
153 return false;
154 break;
155 case LOWER:
156 if (record->event.pressed) {
157 layer_on(_LOWER);
158 update_tri_layer(_LOWER, _RAISE, _ADJUST);
159 } else {
160 layer_off(_LOWER);
161 update_tri_layer(_LOWER, _RAISE, _ADJUST);
162 }
163 return false;
164 break;
165 case RAISE:
166 if (record->event.pressed) {
167 layer_on(_RAISE);
168 update_tri_layer(_LOWER, _RAISE, _ADJUST);
169 } else {
170 layer_off(_RAISE);
171 update_tri_layer(_LOWER, _RAISE, _ADJUST);
172 }
173 return false;
174 break;
175 case BACKLIT:
176 if (record->event.pressed) {
177 register_code(KC_RSFT);
178 #ifdef BACKLIGHT_ENABLE
179 backlight_step();
180 #endif
181 } else {
182 unregister_code(KC_RSFT);
183 }
184 return false;
185 break;
186 }
187 return true;
188};
189
190void matrix_init_user(void) {
191 #ifdef AUDIO_ENABLE
192 startup_user();
193 #endif
194}
195
196#ifdef AUDIO_ENABLE
197
198void startup_user()
199{
200 _delay_ms(20); // gets rid of tick
201 PLAY_NOTE_ARRAY(tone_startup, false, 0);
202}
203
204void shutdown_user()
205{
206 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
207 _delay_ms(150);
208 stop_all_notes();
209}
210
211void music_on_user(void)
212{
213 music_scale_user();
214}
215
216void music_scale_user(void)
217{
218 PLAY_NOTE_ARRAY(music_scale, false, 0);
219}
220
221#endif
diff --git a/keyboards/preonic/keymaps/nikchi/readme.md b/keyboards/preonic/keymaps/nikchi/readme.md
new file mode 100644
index 000000000..e911968dd
--- /dev/null
+++ b/keyboards/preonic/keymaps/nikchi/readme.md
@@ -0,0 +1 @@
# The default Preonic layout - largely based on the Planck's \ No newline at end of file
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 0227fbdd7..75f35112b 100644
--- a/quantum/process_keycode/process_unicodemap.c
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -49,7 +49,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
49 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { 49 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
50 const uint32_t* map = unicode_map; 50 const uint32_t* map = unicode_map;
51 uint16_t index = keycode - QK_UNICODE_MAP; 51 uint16_t index = keycode - QK_UNICODE_MAP;
52 uint32_t code = pgm_read_dword_far(&map[index]); 52 uint32_t code = pgm_read_dword(&map[index]);
53 if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) { 53 if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
54 // Convert to UTF-16 surrogate pair 54 // Convert to UTF-16 surrogate pair
55 code -= 0x10000; 55 code -= 0x10000;