aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build_keyboard.mk7
-rw-r--r--keyboards/ergodox/keymaps/coderkun_neo2/keymap.c2
-rw-r--r--keyboards/ergodox/keymaps/ordinary/keymap.c168
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-base.pngbin98200 -> 120512 bytes
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-base.txt6
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-media.pngbin123435 -> 123523 bytes
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-media.txt8
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-symbol.pngbin101255 -> 90642 bytes
-rw-r--r--keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt22
-rw-r--r--keyboards/ergodox/keymaps/ordinary/readme.md41
-rw-r--r--keyboards/ergodox/keymaps/twey/keymap.c1
-rw-r--r--keyboards/handwired/promethium/config.h104
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/README.md44
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/config.h8
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/keymap.c452
-rw-r--r--keyboards/handwired/promethium/keymaps/priyadi/readme.md0
-rw-r--r--keyboards/handwired/promethium/promethium.c4
-rw-r--r--keyboards/handwired/promethium/promethium.h106
-rw-r--r--keyboards/planck/keymaps/cbbrowne/config.h4
-rw-r--r--keyboards/planck/keymaps/priyadi/config.h39
-rw-r--r--keyboards/planck/keymaps/priyadi/keymap.c681
-rw-r--r--keyboards/planck/keymaps/unicode/keymap.c45
-rw-r--r--quantum/audio/voices.c1
-rw-r--r--quantum/keymap_common.c3
-rw-r--r--quantum/keymap_extras/keymap_french.h4
-rw-r--r--quantum/process_keycode/process_ucis.c133
-rw-r--r--quantum/process_keycode/process_ucis.h35
-rw-r--r--quantum/process_keycode/process_unicode.c285
-rw-r--r--quantum/process_keycode/process_unicode.h160
-rw-r--r--quantum/process_keycode/process_unicode_common.c85
-rw-r--r--quantum/process_keycode/process_unicode_common.h132
-rw-r--r--quantum/process_keycode/process_unicodemap.c54
-rw-r--r--quantum/process_keycode/process_unicodemap.h9
-rw-r--r--quantum/quantum.c13
-rw-r--r--quantum/quantum.h10
-rw-r--r--quantum/quantum_keycodes.h16
-rw-r--r--tmk_core/common/action_layer.c12
-rw-r--r--tmk_core/common/action_layer.h5
-rw-r--r--util/travis_compiled_push.sh2
39 files changed, 1182 insertions, 1519 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk
index c8e82cf0e..4a6fc0980 100644
--- a/build_keyboard.mk
+++ b/build_keyboard.mk
@@ -168,16 +168,19 @@ endif
168 168
169ifeq ($(strip $(UCIS_ENABLE)), yes) 169ifeq ($(strip $(UCIS_ENABLE)), yes)
170 OPT_DEFS += -DUCIS_ENABLE 170 OPT_DEFS += -DUCIS_ENABLE
171 UNICODE_ENABLE = yes 171 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
172 SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
172endif 173endif
173 174
174ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) 175ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
175 OPT_DEFS += -DUNICODEMAP_ENABLE 176 OPT_DEFS += -DUNICODEMAP_ENABLE
176 UNICODE_ENABLE = yes 177 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
178 SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
177endif 179endif
178 180
179ifeq ($(strip $(UNICODE_ENABLE)), yes) 181ifeq ($(strip $(UNICODE_ENABLE)), yes)
180 OPT_DEFS += -DUNICODE_ENABLE 182 OPT_DEFS += -DUNICODE_ENABLE
183 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
181 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c 184 SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
182endif 185endif
183 186
diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
index b62b14449..aaf75d58f 100644
--- a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
+++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c
@@ -312,6 +312,8 @@ uint16_t hex_to_keycode(uint8_t hex)
312 return NEO_E; 312 return NEO_E;
313 case 0xF: 313 case 0xF:
314 return NEO_F; 314 return NEO_F;
315 default:
316 return KC_NO;
315 } 317 }
316 } 318 }
317} 319}
diff --git a/keyboards/ergodox/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c
index 5c01d9678..1dfdf7e62 100644
--- a/keyboards/ergodox/keymaps/ordinary/keymap.c
+++ b/keyboards/ergodox/keymaps/ordinary/keymap.c
@@ -9,6 +9,7 @@
9#define SYMB 1 // symbols layer 9#define SYMB 1 // symbols layer
10#define MDIA 2 // media layer 10#define MDIA 2 // media layer
11#define SPEC 3 // special layer 11#define SPEC 3 // special layer
12#define RBASE 4 // reverse default layer
12 13
13#define LSymb 10 // left symbol-shift key 14#define LSymb 10 // left symbol-shift key
14#define LMdia 11 // left media-shift key 15#define LMdia 11 // left media-shift key
@@ -17,15 +18,23 @@
17#define RMdia 14 // right media-shift key 18#define RMdia 14 // right media-shift key
18#define RSpec 15 // right special-shift key 19#define RSpec 15 // right special-shift key
19 20
21#define NotEq 16 // != macro
22#define GrtEq 17 // >= macro
23#define LesEq 18 // <= macro
24#define DeRef 19 // -> macro
25
20#define MUL 20 // mouse up left 26#define MUL 20 // mouse up left
21#define MUR 21 // mouse up right 27#define MUR 21 // mouse up right
22#define MDL 22 // mouse down left 28#define MDL 22 // mouse down left
23#define MDR 23 // mouse down right 29#define MDR 23 // mouse down right
24 30
31
32
25/* 33/*
26 * The Ordinary Layout for the Ergodox EZ keyboard, v4.20 34 * The Ordinary Layout for the Ergodox EZ keyboard, v5
27 * 35 *
28 * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com 36 * Modifications from the default Ergodox EZ layout
37 * by Nicholas Keene ergodoxez@nicholaskeene.com
29 * 38 *
30 * No rights reserved. This software is in the public domain. 39 * No rights reserved. This software is in the public domain.
31 * Credit me if you are friendly but if you're a jerk don't bother. 40 * Credit me if you are friendly but if you're a jerk don't bother.
@@ -44,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
44 * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| 53 * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------|
45 * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | 54 * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media |
46 * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| 55 * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------|
47 * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | 56 * | Symbol | ^A | S | D | ^F | G |------| |------| H | ^J | K | L | ^; | '" Symbol |
48 * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| 57 * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------|
49 * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | 58 * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals |
50 * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' 59 * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------'
@@ -60,24 +69,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
60 */ 69 */
61[BASE] = KEYMAP( 70[BASE] = KEYMAP(
62// left hand 71// left hand
63 F(LSpec) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC 72 F(LSpec) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC
64,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC 73,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC
65,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G 74,M(LSymb) ,LT(RBASE, KC_A),KC_S ,KC_D ,LT(RBASE, KC_F) ,KC_G
66,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) 75,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB)
67,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI 76,KC_LCTL ,MEH_T(KC_NO) ,ALL_T(KC_NO),KC_LALT,KC_LGUI
68 ,KC_HOME,KC_END 77 ,KC_HOME,KC_END
69 ,KC_PGUP 78 ,KC_PGUP
70 ,KC_BSPC,KC_DEL ,KC_PGDN 79 ,KC_BSPC,KC_DEL ,KC_PGDN
71 // right hand 80 // right hand
72 ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) 81 ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec)
73 ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) 82 ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia)
74 ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) 83 ,KC_H ,LT(RBASE, KC_J),KC_K ,KC_L ,LT(RBASE,KC_SCLN),F(RSymb)
75 ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT 84 ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT
76 ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL 85 ,KC_RGUI ,KC_RALT,KC_HYPR,KC_MEH ,KC_RCTL
77 ,KC_LEFT ,KC_RGHT 86 ,KC_LEFT ,KC_RGHT
78 ,KC_UP 87 ,KC_UP
79 ,KC_DOWN ,KC_ENT ,KC_SPC 88 ,KC_DOWN ,KC_ENT ,KC_SPC
80 ), 89),
81 90
82/******* Symbols Layer ************************************************************************************************* 91/******* Symbols Layer *************************************************************************************************
83 * 92 *
@@ -87,52 +96,52 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
87 * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | 96 * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | |
88 * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| 97 * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
89 * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | 98 * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | |
90 * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| 99 * |-----------+------+------+------+------+------| ' | | " |------+------+------+------+------+-----------|
91 * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | 100 * | | % | ^ | [ | ] | ~ | | | | \ | 1 | 2 | 3 | - | |
92 * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' 101 * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
93 * | LCtrl | Meh |Hyper | LAlt | LGui | | 0 | . | = | + | Ent | 102 * | ; | & | * | < | > | | 0 | . | = | + | Enter |
94 * `-----------------------------------' `-----------------------------------' 103 * `-----------------------------------' `-----------------------------------'
95 * ,-------------. ,-------------. 104 * ,-------------. ,-------------.
96 * | Left | Right| | Home | End | 105 * | |||| | |||| | | |||| | |||| |
97 * ,------|------|------| |------+------+------. 106 * ,------|------|------| |------+------+------.
98 * | | | Up | | PgUp | | | 107 * | Plus | Equal| |||| | | |||| | Under| Dash |
99 * |Space |Enter |------| |------|BackSp| Del | 108 * | | |------| |------| Score| |
100 * | | | Down | | PgDn | | | 109 * | + | = | != | | -> | _ | - |
101 * `--------------------' `--------------------' 110 * `--------------------' `--------------------'
102 */ 111 */
103[SYMB] = KEYMAP( 112[SYMB] = KEYMAP(
104// left hand 113// left hand
105 KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC 114 KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC
106,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) 115,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM)
107,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV 116,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV
108,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB 117,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_QUOT
109,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI 118,KC_SCLN ,KC_AMPR ,KC_ASTR ,LSFT(KC_COMM),LSFT(KC_DOT)
110 ,KC_LEFT ,KC_RGHT 119 ,M(GrtEq),M(LesEq)
111 ,KC_UP 120 ,KC_NO
112 ,KC_SPC ,KC_ENT ,KC_DOWN 121 ,KC_PLUS ,KC_EQL ,M(NotEq)
113 // right hand 122 // right hand
114 ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS 123 ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS
115 ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS 124 ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS
116 ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS 125 ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS
117 ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS 126 ,LSFT(KC_QUOT),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS
118 ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT 127 ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT
119 ,KC_HOME ,KC_END 128 ,KC_NO ,KC_NO
120 ,KC_PGUP 129 ,KC_NO
121 ,KC_PGDN ,KC_BSPC ,KC_DEL 130 ,M(DeRef) ,LSFT(KC_MINS),KC_MINS
122), 131),
123 132
124/******* Media Layer ******************************************************************************************************* 133/******* Media Layer *******************************************************************************************************
125 * 134 *
126 * ,---------------------------------------------------------------. ,---------------------------------------------------------------. 135 * ,---------------------------------------------------------------. ,---------------------------------------------------------------.
127 * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | 136 * | | F11 | F12 | F13 | F14 | F15 | Esc | | |||| | F16 | F17 | F18 | F19 | F20 | |
128 * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| 137 * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------|
129 * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | 138 * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | |
130 * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| 139 * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------|
131 * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | 140 * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | |
132 * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| 141 * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------|
133 * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | 142 * | | |||| |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | |||| | End | Down | PgDn | |||| | |
134 * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' 143 * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------'
135 * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| 144 * | ||| | |||| | MClick | LClick | R Click| | Insert | Del | |||| | |||| | ||| |
136 * `---------------------------------------------' `---------------------------------------------' 145 * `---------------------------------------------' `---------------------------------------------'
137 * ,-------------. ,-------------. 146 * ,-------------. ,-------------.
138 * | Stop |Refrsh| | Prev | Next | 147 * | Stop |Refrsh| | Prev | Next |
@@ -148,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
148,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U 157,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U
149,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD 158,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD
150,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D 159,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D
151,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 160,KC_NO ,KC_NO ,KC_BTN3 ,KC_BTN1 ,KC_BTN2
152 ,KC_WSTP ,KC_WREF 161 ,KC_WSTP ,KC_WREF
153 ,KC_WSCH 162 ,KC_WSCH
154 ,KC_WBAK ,KC_NO ,KC_WHOM 163 ,KC_WBAK ,KC_NO ,KC_WHOM
@@ -157,7 +166,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
157 ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS 166 ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS
158 ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS 167 ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS
159 ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS 168 ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS
160 ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL 169 ,KC_INS ,KC_DEL ,KC_NO ,KC_NO ,KC_NO
161 ,KC_MPRV ,KC_MNXT 170 ,KC_MPRV ,KC_MNXT
162 ,KC_VOLU 171 ,KC_VOLU
163 ,KC_VOLD ,KC_MSTP ,KC_MPLY 172 ,KC_VOLD ,KC_MSTP ,KC_MPLY
@@ -203,7 +212,49 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
203 ,KC_TRNS ,KC_TRNS 212 ,KC_TRNS ,KC_TRNS
204 ,KC_TRNS 213 ,KC_TRNS
205 ,KC_TRNS ,KC_TRNS ,KC_TRNS 214 ,KC_TRNS ,KC_TRNS ,KC_TRNS
206 ) 215),
216
217/******* Reverse Base Layer *********************************************************************************************
218 *
219 * ,------------------------------------------------------. ,------------------------------------------------------.
220 * | =+ | 0 | 9 | 8 | 7 | 6 | - | | Esc | 5 | 4 | 3 | 2 | 1 | `~ |
221 * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------|
222 * | \| | P | O | I | U | Y | ] | | [ | T | R | E | W | Q | Tab |
223 * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------|
224 * | '" | ; | L | K | J | H |------| |------| G | F | D | S | A | |
225 * |------------+------+------+------+------+------| Tab | |Shift |------+------+------+------+------+------------|
226 * | Capitals | / | . | , | M | N | | | -Tab | B | V | C | X | Z | Capitals |
227 * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------'
228 * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl |
229 * `-----------------------------------' `-----------------------------------'
230 * ,-------------. ,-------------.
231 * | Left | Right| | Home | End |
232 * ,------|------|------| |------+------+------.
233 * | | | Up | | PgUp | | |
234 * |Space |Enter |------| |------|BackSp| Del |
235 * | | | Down | | PgDn | | |
236 * `--------------------' `--------------------'
237 */
238[RBASE] = KEYMAP(
239// left hand
240 KC_EQL ,KC_0 ,KC_9 ,KC_8 ,KC_7 ,KC_6 ,KC_MINS
241,KC_BSLS ,KC_P ,KC_O ,KC_I ,KC_U ,KC_Y ,KC_RBRC
242,KC_QUOT ,LT(RBASE, KC_SCLN) ,KC_L ,KC_K ,LT(RBASE, KC_J) ,KC_H
243,KC_RSFT ,KC_SLSH ,KC_DOT ,KC_COMM,KC_M ,KC_N ,KC_TAB
244,KC_RCTL ,MEH_T(KC_NO),ALL_T(KC_NO),KC_RALT,KC_RGUI
245 ,KC_LEFT ,KC_RGHT
246 ,KC_UP
247 ,KC_SPC ,KC_ENT ,KC_DOWN
248 // right hand
249 ,KC_ESC ,KC_5 ,KC_4 ,KC_3 ,KC_2 ,KC_1 ,KC_GRV
250 ,KC_LBRC ,KC_T ,KC_R ,KC_E ,KC_W ,KC_Q ,KC_TAB
251 ,KC_G ,LT(RBASE, KC_F),KC_D ,KC_S ,LT(RBASE, KC_A) ,KC_NO
252 ,LSFT(KC_TAB),KC_B ,KC_V ,KC_C ,KC_X ,KC_Z ,KC_LSFT
253 ,KC_LGUI,KC_LALT,KC_HYPR ,KC_MEH,KC_LCTL
254 ,KC_HOME ,KC_END
255 ,KC_PGUP
256 ,KC_PGDN ,KC_BSPC ,KC_DEL
257)
207}; 258};
208 259
209const uint16_t PROGMEM fn_actions[] = { 260const uint16_t PROGMEM fn_actions[] = {
@@ -227,14 +278,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
227{ 278{
228 switch(id) { 279 switch(id) {
229 // There are two shift keys for each layer so we increment a layer_shift var when one 280 // There are two shift keys for each layer so we increment a layer_shift var when one
230 // is pressed and decrement when one is released. If both are pressed at the same time 281 // is pressed and decrement when one is released. The shift counts are bound between 0 and 2
231 // then the layer is locked (or unlocked). The shift counts are bound between 0 and 2
232 // only because sometimes rapid pressing led to irregular events; this way the states 282 // only because sometimes rapid pressing led to irregular events; this way the states
233 // are self healing during use. 283 // are self healing during use.
234 284
235 case LSymb: // 285 case LSymb: //
236 if (record->event.pressed) { // when the LSymb button is pressed 286 if (record->event.pressed) { // when the LSymb button is pressed
237 if(++symb_shift > 2) mdia_shift = 2; // increment the symb shift count, max two 287 if(++symb_shift > 2) symb_shift = 2; // increment the symb shift count, max two
238 if(spec_shift) symb_lock = !symb_lock; // if the Special layer is on, toggle the shift lock 288 if(spec_shift) symb_lock = !symb_lock; // if the Special layer is on, toggle the shift lock
239 layer_on(SYMB); // in any case, turn on the Symbols layer 289 layer_on(SYMB); // in any case, turn on the Symbols layer
240 } else { // when the LSymb button is released 290 } else { // when the LSymb button is released
@@ -264,7 +314,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
264 314
265 case LSpec: 315 case LSpec:
266 if (record->event.pressed) { // when the LSpec button is pressed 316 if (record->event.pressed) { // when the LSpec button is pressed
267 if(symb_shift) symb_lock == !symb_lock; // if another layer button is engaged, then 317 if(symb_shift) symb_lock = !symb_lock; // if another layer button is engaged, then
268 else if(mdia_shift) mdia_lock = !mdia_lock; // lock that layer, be it caps or symb or mdia 318 else if(mdia_shift) mdia_lock = !mdia_lock; // lock that layer, be it caps or symb or mdia
269 else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) { 319 else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) {
270 register_code(KC_GRV); // otherwise, if it's an uninterrupted tap, emit a char 320 register_code(KC_GRV); // otherwise, if it's an uninterrupted tap, emit a char
@@ -340,6 +390,30 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
340 } 390 }
341 break; 391 break;
342 392
393 case NotEq:
394 if (record->event.pressed) {
395 return MACRO( I(10), D(LSFT), T(EXLM), U(LSFT), T(EQL), END ); // !=
396 }
397 break;
398
399 case GrtEq:
400 if (record->event.pressed) {
401 return MACRO( I(10), D(LSFT), T(COMM), U(LSFT), T(EQL), END ); // <=
402 }
403 break;
404
405 case LesEq:
406 if (record->event.pressed) {
407 return MACRO( I(10), D(LSFT), T(DOT), U(LSFT), T(EQL), END ); // >=
408 }
409 break;
410
411 case DeRef:
412 if (record->event.pressed) {
413 return MACRO( I(10), T(MINS), D(LSFT), T(DOT), U(LSFT), END ); // ->
414 }
415 break;
416
343 // mouse diagonals 417 // mouse diagonals
344 418
345 case MUL: // mouse up left 419 case MUL: // mouse up left
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-base.png b/keyboards/ergodox/keymaps/ordinary/ordinary-base.png
index 831db4f5d..18c6c4ab2 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-base.png
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-base.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-base.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-base.txt
index 7763c3d37..4fc11faf9 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-base.txt
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-base.txt
@@ -7,10 +7,10 @@
7[{y:-0.875,x:5.5},"T",{h:1.5},"{\n\n\n\n\n\n[",{x:4.5,h:1.5},"}\n\n\n\n\n\n]","Y"], 7[{y:-0.875,x:5.5},"T",{h:1.5},"{\n\n\n\n\n\n[",{x:4.5,h:1.5},"}\n\n\n\n\n\n]","Y"],
8[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\nTab\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Q",{x:14.5},"P",{c:"#c6c600",t:"#002299",w:1.5},"|\n\\\nMedia\n\n\n\n\nShift"], 8[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\nTab\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Q",{x:14.5},"P",{c:"#c6c600",t:"#002299",w:1.5},"|\n\\\nMedia\n\n\n\n\nShift"],
9[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000"},"D",{x:10.5},"K"], 9[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000"},"D",{x:10.5},"K"],
10[{y:-0.875,x:2.5},"S",{x:1},"F",{x:8.5},"J",{x:1},"L"], 10[{y:-0.875,x:2.5},"S",{x:1,fa:[0,0,0,1]},"F\n\n\nreverse",{x:8.5},"J\n\n\nreverse",{x:1},"L"],
11[{y:-0.875,x:5.5},"G",{x:6.5},"H"], 11[{y:-0.875,x:5.5},"G",{x:6.5},"H"],
12[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"A",{x:14.5},":\n;",{c:"#c6c600",t:"#007d00",w:1.5},"\"\n'\nSymbols\n\n\n\n\nShift"], 12[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"A\n\n\nreverse",{x:14.5},":\n;\n\nreverse",{c:"#c6c600",t:"#007d00",w:1.5},"\"\n'\nSymbols\n\n\n\n\nShift"],
13[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"], 13[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"],
14[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], 14[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"],
15[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], 15[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."],
16[{y:-0.875,x:5.5},"B",{x:6.5},"N"], 16[{y:-0.875,x:5.5},"B",{x:6.5},"N"],
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png
index 5ff3f5338..491f698d8 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt
index e1467b22e..67b7840b5 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt
@@ -15,10 +15,10 @@
15[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"], 15[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"],
16[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""], 16[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""],
17[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], 17[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"],
18[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff",fa:[0,0,0,1]},"Delete\n\n\nOption"], 18[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff"},"Delete"],
19[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert\n\n\nCmd",{x:1,c:"#dddd77"},"Hyper"], 19[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert",{x:1,c:"#737373",a:7},""],
20[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], 20[{y:-0.75,x:0.5},"","",{x:14.5},"",""],
21[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], 21[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee",a:4,fa:[0,0,0,1]},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"],
22[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], 22[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"],
23[{x:2},"Home\n\n\nBrowser"], 23[{x:2},"Home\n\n\nBrowser"],
24[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], 24[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"],
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png
index dd9086329..1277f7483 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png
Binary files differ
diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt
index 001bf370d..65eca9d6a 100644
--- a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt
+++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt
@@ -10,18 +10,18 @@
10[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], 10[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"],
11[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], 11[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"],
12[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], 12[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"],
13[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], 13[{y:-0.625,x:6.5,c:"#bbddbb",t:"#000000",a:6,h:1.5},"'",{x:4.5,h:1.5},"\""],
14[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], 14[{y:-0.75,x:3.5,a:4},"[",{x:10.5,c:"#89b087"},"2"],
15[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], 15[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"],
16[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], 16[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"],
17[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], 17[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"],
18[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},"."], 18[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"<",{x:10.5,c:"#89b087"},"."],
19[{y:-0.875,x:2.5,c:"#dddd77"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0",{x:1},"="], 19[{y:-0.875,x:2.5,c:"#bbddbb"},"*",{x:1},">",{x:8.5,c:"#89b087"},"0",{x:1},"="],
20[{y:-0.75,x:0.5,c:"#dddd77"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+","Enter"], 20[{y:-0.75,x:0.5,c:"#bbddbb"},";","&",{x:14.5,c:"#89b087"},"+","Enter"],
21[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Left","Right"], 21[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#bbddbb"},"<=",">="],
22[{h:2},"Space",{h:2},"Enter","Up"], 22[{a:7,h:2},"+",{h:2},"=",{c:"#737373"},""],
23[{x:2},"Down"], 23[{x:2,c:"#bbddbb",a:4},"!="],
24[{r:-30,rx:13,y:-1,x:-3},"Home","End"], 24[{r:-30,rx:13,y:-1,x:-3,c:"#737373",a:7},"",""],
25[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], 25[{x:-3},"",{c:"#bbddbb",h:2},"_",{h:2},"-"],
26[{x:-3},"Page\n\n\n\n\n\nDown"] 26[{x:-3,a:4},"->"]
27 27
diff --git a/keyboards/ergodox/keymaps/ordinary/readme.md b/keyboards/ergodox/keymaps/ordinary/readme.md
index 820b80b45..e13cb7ec8 100644
--- a/keyboards/ergodox/keymaps/ordinary/readme.md
+++ b/keyboards/ergodox/keymaps/ordinary/readme.md
@@ -10,12 +10,13 @@ no rights reserved, use for any purposes, credit me if you are a nice person
10 10
11## The Base Layout ## 11## The Base Layout ##
12 12
13* *White Keys* are all the normal characters and symbols in all the normal locations (except for the brackets). 13* *White Keys* are all the normal characters and symbols in all the normal locations (except for the brackets, and who touch-types brackets?).
14* *Modifier Keys* are light yellow and in the traditional location: Control, Option, Command, plus Hyper and Meh. 14* *Modifier Keys* are light yellow and in the traditional locationn at the bottom of the keyboard: Control, Option, Command, plus Hyper and Meh. Modifier keys are only found on the base layout.
15* *Shift Keys* are dark yellow, found on the outsides of the keyboard. Capitals Shift (traditional shift) is found in the usual place and above that is found Symbol Shift, Media Shift, and Special Shift (Shift Lock). 15* *Shift Keys* are dark yellow, found on the outsides of the keyboard. Capitals Shift (traditional Shift) is found in the usual place and above that are Symbol Shift, Media Shift, and Special Shift (Shift Lock).
16* Several of the shift keys double for entry of characters which would typically be in those locations. 16* Several of the shift keys double for entry of characters which would typically be in those locations.
17* *Thumb Keys* shown in orange are for text navigation and manipulation. 17* *Thumb Keys* shown in orange are for text navigation and manipulation.
18* *Escape* is red and it is always found in that location no matter what. 18* The keys under pinky fingers and index fingers will *reverse* the keyboard layout.
19* *Escape* is red and it is always found in that location (*except* when the layout is reversed).
19 20
20![Ordinary base layout](ordinary-base.png) 21![Ordinary base layout](ordinary-base.png)
21 22
@@ -23,12 +24,16 @@ The four big orange keys are arranged differently than in the default Ergodox EZ
23 24
24The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. 25The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code.
25 26
27#### Reversing The Base Layout ####
28
29The Ordinary Layout can be used to perform one-handed chorded text input. If you hold down the key under either index finger or either pinky finger (A, F, J and Semicolon), the whole base layout reverses order. Most keys are _mirrored_ but the delete keys, home/end, and left/right arrow keys are merely *translated* to preserve directionality. Pro-tip: This feature is particularly handly for bringing the Enter key to the left hand when the right hand is using the mouse.
30
26## The Symbols Layer ## 31## The Symbols Layer ##
27 32
28* *Symbols* shown in light green. All kinds of brackets are available on this layer. Ampersand and Pipe justapose each other. Pipe, slash, and backslash are arranged in a column. 33* *Symbols* shown in light green. All kinds of brackets are available on this layer. Ampersand and Pipe juxtapose each other. Pipe, slash, and backslash are arranged in a column.
29* *F-Keys* are bright green and overlay the row of numerals. 34* *F-Keys* are bright green and overlay the row of numerals. This layer has F1-F10, higher *F-Keys* are on the Symbols layer.
30* *Number pad* in dark green under the right hand includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads so that NumLock is not needed. 35* *Number pad* in dark green under the right hand includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads so that NumLock is not needed.
31* *Thumb keys* on this layer are the *reverse* of the orange keys on the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. 36* The dark gray keys do nothing in case you bump them by accident.
32 37
33![Ordinary symbol layout](ordinary-symbol.png) 38![Ordinary symbol layout](ordinary-symbol.png)
34 39
@@ -42,7 +47,7 @@ The Symbols Layer is based on the Coder Layer from the default Ergodox EZ layout
42* Higher-order *F-Keys* are shown in bright green overylaying the numerals. 47* Higher-order *F-Keys* are shown in bright green overylaying the numerals.
43* *Application Keys* to control web browsers and audio players are dark purple but don't get too excited because these have weak support on operating systems I've looked at. Good luck. 48* *Application Keys* to control web browsers and audio players are dark purple but don't get too excited because these have weak support on operating systems I've looked at. Good luck.
44* The light purple keys are various operating system keys such as NumLock and Mute and a button to navigate to My Computer (usually your home dir). 49* The light purple keys are various operating system keys such as NumLock and Mute and a button to navigate to My Computer (usually your home dir).
45* The dark gray keys do nothing in case you bump them by accident 50* The dark gray keys do nothing in case you bump them by accident.
46 51
47![Ordinary media layout](ordinary-media.png) 52![Ordinary media layout](ordinary-media.png)
48 53
@@ -64,27 +69,33 @@ Multiple layers can be turned on at once. The Capitals layer will affect charact
64 69
65The Special Shift layer is mostly used to lock the shift keys but in order to make this layout more _ordinary_ there are a few special sequences which put some keys near their most common traditional locations. 70The Special Shift layer is mostly used to lock the shift keys but in order to make this layout more _ordinary_ there are a few special sequences which put some keys near their most common traditional locations.
66 71
67### Escape ### 72#### Escape ####
68 73
69The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, which is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. 74The One True Location for an Escape key is separated from the rest of the keys, way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location, however, and the nearest one is home to the tilde (er, *grave*) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, which is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape.
70 75
71The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. 76The Ordinary layout offers as a consolation prize, a Special sequence for Escape: **Special Shift + 1**. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers.
72 77
73### Backspace ### 78#### Backspace ####
74 79
75At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence using the 0 key to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. 80At the top right corner of the Ergodox EZ you can do **Special Shift + 0** to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times.
76 81
77### Other Characters ### 82#### Other Characters ####
78 83
79The Escape and Backspace special sequences are so useful why not have a few more? You can find dash under 9, left bracket under o, and right bracket under p. That's pretty much all the characters from the top right corner of the keyboard which moved to make room for the columnar layout. 84The Escape and Backspace special sequences are so useful why not have a few more? You can find dash under 9, left bracket under o, and right bracket under p. That's pretty much all the characters from the top right corner of the keyboard which moved to make room for the columnar layout.
80 85
86## Errata ##
87
88Some of the symbols on the Symbols layer are produced by the keyboard by "capitalizing" another character (such as *!* from *1*) so when you type that key you will notice the Capitals Shift red LED turn on.
89
81**** 90****
82 91
83The Ordinary Layout for the Ergodox EZ keyboard, v4.20 92The Ordinary Layout for the Ergodox EZ keyboard, v5
84 93
85Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com 94Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com
86 95
87No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. 96No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother.
88 97
98Keyboard layout images were created with http://www.keyboard-layout-editor.com/ by Ian Prest my thanks to that free service
99
89Details: readme.md 100Details: readme.md
90 https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary 101 https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary
diff --git a/keyboards/ergodox/keymaps/twey/keymap.c b/keyboards/ergodox/keymaps/twey/keymap.c
index 5deacd63f..1ecbce466 100644
--- a/keyboards/ergodox/keymaps/twey/keymap.c
+++ b/keyboards/ergodox/keymaps/twey/keymap.c
@@ -205,6 +205,7 @@ void matrix_init_user(void) {
205 205
206// Runs constantly in the background, in a loop. 206// Runs constantly in the background, in a loop.
207void matrix_scan_user(void) { 207void matrix_scan_user(void) {
208 __attribute__ ((unused))
208 uint32_t layer0 = layer_state & (1UL << 0), 209 uint32_t layer0 = layer_state & (1UL << 0),
209 layer1 = layer_state & (1UL << 1), 210 layer1 = layer_state & (1UL << 1),
210 layer2 = layer_state & (1UL << 2), 211 layer2 = layer_state & (1UL << 2),
diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h
index fd45c2bfe..24f02993f 100644
--- a/keyboards/handwired/promethium/config.h
+++ b/keyboards/handwired/promethium/config.h
@@ -152,6 +152,110 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
152//#define NO_ACTION_MACRO 152//#define NO_ACTION_MACRO
153//#define NO_ACTION_FUNCTION 153//#define NO_ACTION_FUNCTION
154 154
155#define PS2_INIT_DELAY 2000
156#define BATTERY_PIN 9
157#define BATTERY_POLL 30000
158#define MAX_VOLTAGE 4.2
159#define MIN_VOLTAGE 3.2
160
161#define KEYMAP( \
162 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
163 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
164 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
165 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
166) \
167{ \
168 {k11, k12, k13, k14, k15, k16}, \
169 {k21, k22, k23, k24, k25, k26}, \
170 {k31, k32, k33, k34, k35, k36}, \
171 {k41, k42, k43, k44, k45, k46}, \
172 {k17, k18, k19, k1a, k1b, k1c}, \
173 {k27, k28, k29, k2a, k2b, k2c}, \
174 {k37, k38, k39, k3a, k3b, k3c}, \
175 {k47, k48, k49, k4a, k4b, k4c} \
176}
177
178#ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file
179enum led_sequence {
180 LED_IND_BLUETOOTH,
181 LED_IND_USB,
182 LED_IND_BATTERY,
183
184 LED_IND_FUN,
185 LED_IND_NUM,
186 LED_IND_EMOJI,
187
188 LED_BKSP,
189 LED_ENT,
190 LED_RSFT,
191 LED_RCTL,
192
193 LED_RGUI,
194 LED_SLSH,
195 LED_SCLN,
196 LED_P,
197
198 LED_O,
199 LED_L,
200 LED_DOT,
201 LED_RALT,
202
203 LED_EMOJI,
204 LED_COMM,
205 LED_K,
206 LED_I,
207
208 LED_U,
209 LED_J,
210 LED_M,
211 LED_FUN,
212
213 LED_RSPC,
214 LED_N,
215 LED_HH,
216 LED_Y,
217
218 LED_TRACKPOINT3,
219 LED_TRACKPOINT2,
220 LED_TRACKPOINT1,
221
222 LED_LSPC,
223 LED_B,
224 LED_G,
225 LED_T,
226
227 LED_R,
228 LED_F,
229 LED_V,
230 LED_NUM,
231
232 LED_PUNC,
233 LED_C,
234 LED_D,
235 LED_E,
236
237 LED_W,
238 LED_S,
239 LED_X,
240 LED_LALT,
241
242 LED_LGUI,
243 LED_Z,
244 LED_A,
245 LED_Q,
246
247 LED_TAB,
248 LED_ESC,
249 LED_LSFT,
250 LED_LCTL,
251
252 LED_TOTAL
253};
254
255#define RGB_DI_PIN B5
256#define RGBSPS_NUM LED_TOTAL
257#endif
258
155/* PS/2 mouse */ 259/* PS/2 mouse */
156#ifdef PS2_USE_BUSYWAIT 260#ifdef PS2_USE_BUSYWAIT
157# define PS2_CLOCK_PORT PORTD 261# define PS2_CLOCK_PORT PORTD
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/README.md b/keyboards/handwired/promethium/keymaps/priyadi/README.md
new file mode 100644
index 000000000..37c2be6f9
--- /dev/null
+++ b/keyboards/handwired/promethium/keymaps/priyadi/README.md
@@ -0,0 +1,44 @@
1Priyadi Keymap for Planck-like Keyboards
2========================================
3
4Main layer modifications from default Planck layout:
5
6* Enter moved to quotes position
7* Quotes moved to semicolon position.
8* QWERTZ style colon & semicolon. shift-. = : shift-, = ; This is done in hardware, no layout switching needed in software.
9* < & > occupied precious real estate, and so they are moved down to punctuation layer.
10* Right-shift on Enter position.
11* Removed arrow keys, they are on another layer now.
12* Put Ctrl-Alt-Super and Super-AltGr-Ctrl in left & right corners.
13* Lower & Raise is now called Num and Fun.
14* OS & Left keys become another thumb modifier: Empty & Greek (Empty because I used this for another use and my muscle memory is not adapted to it yet)
15
16On Promethium, Trackpoint is enabled on PD2 and PD2. We impersonate a Thinkpad keyboard to be able to use Thinkpad driver on Windows (still needs verification).
17
18AltGr & Compose dual use key. Tap for Compose (mapped to Scroll Lock in hardware) and press for AltGr.
19
20Supported layouts: QWERTY, DVORAK, Colemak, Workman, Norman. Switchable from SYS layer. In DVORAK, semicolon is replaced by /? key.
21
22Num activates NUM layer: hexkeypad on the right side and most punctuation on the left side. Hexkeypad is optimized for C-style hex, IPv6, HTML RGB triplets, etc.
23
24Fun activates FUN layer: arrow cluster on right home row, F-numbers on left side.
25
26Pressing Num+Fun activates PUNC layer: same punctuations as NUM layer on the left side, parens on the right side.
27
28Greek activates either GREEKU or GREEKL layer, depending whether shift is pressed or not. Shift state changes are also taken into account when the layer is active.
29
30Greek+Empty activates EMOJI layer. The whole keyboard now outputs emojis!
31
32Pressing both spacebars (spacekeys, actually) activates GUI layer. QWERTYUIOP switches to a virtual desktop. J & L switches virtual desktop to the left or right. S & F behaves like Alt-Tab and Alt-Shift-Tab. This works by sending Alt press when entering the layer, and Alt release when other than S or F keys are pressed.
33
34Pressing both Ctrls activates SYS layer for configuring the keyboard.
35
36On Promethium, USB or Bluetooth output is detected on startup. If USB is connected, then USB is used initially. SYS-U and SYS-B switch output to USB or Bluetooth at runtime. Current active output is indicated with LEDs.
37
38SYS-W, SYS-L, SYS-M switch Unicode input method. SYS-Q, SYS-D, SYS-C, SYS-K, SYS-N switch to QWERTY, DVORAK, Colemak, Workman and Norman, respectively.
39
40On Planck, SYS-A (mnemonic: audio) toggles faux clicky: use buzzer to emit clicks on key presses and releases.
41
42On Promethium there are 6 indicator LEDs, and under switch LEDs on each switches, including Trackpoint buttons. Totaling 57 LEDs. Output is limited to 0xF for each LEDs to conserve power. SYS-G (mnemonic: glow) toggles various backlighting modes.
43
44On Promethium, there's a LED to indicate battery level. Hue indicates level: green is full, red is empty. \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h
index 53059ca7d..3f5dd5817 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/config.h
+++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h
@@ -3,6 +3,8 @@
3 3
4#include "../../config.h" 4#include "../../config.h"
5 5
6#define PRIYADI_PROMETHIUM
7
6/* bootmagic salt key */ 8/* bootmagic salt key */
7#define BOOTMAGIC_KEY_SALT KC_ESC 9#define BOOTMAGIC_KEY_SALT KC_ESC
8 10
@@ -11,8 +13,9 @@
11 13
12#define PREVENT_STUCK_MODIFIERS 14#define PREVENT_STUCK_MODIFIERS
13 15
14#define RGB_DI_PIN B5 16#define RGBSPS_ENABLE
15#define RGBSPS_NUM 57 17
18#define UNICODE_TYPE_DELAY 0
16 19
17#define LAYOUT_DVORAK 20#define LAYOUT_DVORAK
18#define LAYOUT_COLEMAK 21#define LAYOUT_COLEMAK
@@ -20,5 +23,6 @@
20#define LAYOUT_WORKMAN 23#define LAYOUT_WORKMAN
21 24
22#define DOUBLESPACE_LAYER_ENABLE 25#define DOUBLESPACE_LAYER_ENABLE
26// #define TOLELOT_ENABLE
23 27
24#endif 28#endif
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
index 1ad34612e..2c43f9884 100644
--- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
+++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c
@@ -1,14 +1,44 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard, 1/*
2// this is the style you want to emulate. 2Copyright 2017 Priyadi Iman Nurcahyo
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8This program is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY; without even the implied warranty of
10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11GNU General Public License for more details.
12You should have received a copy of the GNU General Public License
13along with this program. If not, see <http://www.gnu.org/licenses/>.
14*/
15
16#if defined(PRIYADI_PROMETHIUM)
17 #include "promethium.h"
18#elif defined(PRIYADI_PLANCK)
19 #include "planck.h"
20#else
21 #error "no keyboard defined"
22#endif
3 23
4#include "promethium.h"
5#include "action_layer.h" 24#include "action_layer.h"
25#ifdef AUDIO_ENABLE
26 #include "audio.h"
27 #include "musical_notes.h"
28#endif
6#include "eeconfig.h" 29#include "eeconfig.h"
7#include "process_unicode.h" 30#include "process_unicode.h"
8#include "quantum.h" 31#include "quantum.h"
32#ifdef RGBSPS_ENABLE
9#include "rgbsps.h" 33#include "rgbsps.h"
34#endif
35#ifdef PS2_MOUSE_ENABLE
10#include "ps2_mouse.h" 36#include "ps2_mouse.h"
11#include "ps2.h" 37#include "ps2.h"
38#endif
39#ifdef FAUXCLICKY_ENABLE
40#include "fauxclicky.h"
41#endif
12#include "outputselect.h" 42#include "outputselect.h"
13#include "led.h" 43#include "led.h"
14#define COUNT(x) (sizeof (x) / sizeof (*(x))) 44#define COUNT(x) (sizeof (x) / sizeof (*(x)))
@@ -41,25 +71,29 @@ enum glow_modes {
41}; 71};
42uint8_t glow_mode = GLOW_MIN; 72uint8_t glow_mode = GLOW_MIN;
43 73
74void turn_off_capslock(void);
44extern keymap_config_t keymap_config; 75extern keymap_config_t keymap_config;
45 76
77// layers, ordering is important!
46enum layers { 78enum layers {
47 _QWERTY, 79 _QWERTY,
48 _DVORAK, 80 _DVORAK,
49 _COLEMAK, 81 _COLEMAK,
50 _WORKMAN, 82 _WORKMAN,
51 _NORMAN, 83 _NORMAN,
52 84 _DEFAULT_LAYER_MAX = _NORMAN,
53 _PUNC,
54 _NUM,
55 _FUNC,
56 85
57 _GREEKU, 86 _GREEKU,
58 _GREEKL, 87 _GREEKL,
59 88
89 _NUM,
90 _FUN,
91 _PUNC,
92
93 _EMPTY,
60 _EMOJI, 94 _EMOJI,
61 _GUI, 95 _GUI,
62 _SYS, 96 _SYS
63}; 97};
64 98
65// double-space layer 99// double-space layer
@@ -74,9 +108,6 @@ enum planck_keycodes {
74 NORMAN, 108 NORMAN,
75 109
76 // layer switchers 110 // layer switchers
77 PUNC,
78 NUM,
79 FUNC,
80 EMOJI, 111 EMOJI,
81 GUI, 112 GUI,
82 GREEK, 113 GREEK,
@@ -90,9 +121,22 @@ enum planck_keycodes {
90 LSPACE, 121 LSPACE,
91 RSPACE, 122 RSPACE,
92 GLOW, 123 GLOW,
93 AUDIO 124
125 // stub
126#ifndef FAUXCLICKY_ENABLE
127 FC_TOG,
128#endif
129#ifndef ADAFRUIT_BLE_ENABLE
130 OUT_BLE,
131#endif
132 KEYCODE_END
94}; 133};
95 134
135#define EMPTY MO(_EMPTY)
136#define NUM MO(_NUM)
137#define FUN MO(_FUN)
138#define FUN0 LT(_FUN, KC_0)
139
96// unicode map 140// unicode map
97 141
98enum unicode_name { 142enum unicode_name {
@@ -196,6 +240,11 @@ enum unicode_name {
196 LOMEG, 240 LOMEG,
197 241
198 FSIGM, 242 FSIGM,
243
244 LTEQ,
245 GTEQ,
246 NOTEQ,
247 PLMIN,
199}; 248};
200 249
201const uint32_t PROGMEM unicode_map[] = { 250const uint32_t PROGMEM unicode_map[] = {
@@ -297,10 +346,17 @@ const uint32_t PROGMEM unicode_map[] = {
297 [LPSI] = 0x03C8, 346 [LPSI] = 0x03C8,
298 [LOMEG] = 0x03C9, 347 [LOMEG] = 0x03C9,
299 [FSIGM] = 0x03C2, 348 [FSIGM] = 0x03C2,
349
350 // other
351 [LTEQ] = 0x2264, // less than or equal
352 [GTEQ] = 0x2265, // greater than or equal
353 [NOTEQ] = 0x2260, // not equal
354 [PLMIN] = 0xB1, // plus minus
300}; 355};
301 356
302// RGBSPS 357// RGBSPS
303 358
359#ifdef RGBSPS_ENABLE
304const uint8_t PROGMEM LED_ALNUM[] = { 360const uint8_t PROGMEM LED_ALNUM[] = {
305 LED_Z, 361 LED_Z,
306 LED_A, 362 LED_A,
@@ -365,14 +421,14 @@ const uint8_t PROGMEM LED_MODS[] = {
365const uint8_t PROGMEM LED_FN[] = { 421const uint8_t PROGMEM LED_FN[] = {
366 LED_PUNC, 422 LED_PUNC,
367 LED_NUM, 423 LED_NUM,
368 LED_FUNC, 424 LED_FUN,
369 LED_EMOJI 425 LED_EMOJI
370}; 426};
371 427
372const uint8_t PROGMEM LED_INDICATORS[] = { 428const uint8_t PROGMEM LED_INDICATORS[] = {
373 LED_IND_EMOJI, 429 LED_IND_EMOJI,
374 LED_IND_NUM, 430 LED_IND_NUM,
375 LED_IND_FUNC, 431 LED_IND_FUN,
376 LED_IND_BATTERY, 432 LED_IND_BATTERY,
377 LED_IND_USB, 433 LED_IND_USB,
378 LED_IND_BLUETOOTH, 434 LED_IND_BLUETOOTH,
@@ -431,7 +487,7 @@ void led_reset(void) {
431void led_set_layer_indicator(void) { 487void led_set_layer_indicator(void) {
432 static uint8_t oldlayer = 255; 488 static uint8_t oldlayer = 255;
433 489
434 rgbsps_set(LED_IND_FUNC, 0, 0, 0); 490 rgbsps_set(LED_IND_FUN, 0, 0, 0);
435 // rgbsps_set(LED_IND_NUM, 0, 0, 0); 491 // rgbsps_set(LED_IND_NUM, 0, 0, 0);
436 rgbsps_set(LED_IND_EMOJI, 0, 0, 0); 492 rgbsps_set(LED_IND_EMOJI, 0, 0, 0);
437 493
@@ -444,14 +500,14 @@ void led_set_layer_indicator(void) {
444 500
445 oldlayer = layer; 501 oldlayer = layer;
446 502
447 if (layer <= _NORMAN) { 503 if (layer <= _DEFAULT_LAYER_MAX) {
448 rgbsps_send(); 504 rgbsps_send();
449 return; 505 return;
450 } 506 }
451 507
452 switch(layer) { 508 switch(layer) {
453 case _FUNC: 509 case _FUN:
454 rgbsps_set(LED_IND_FUNC, 15, 0, 0); 510 rgbsps_set(LED_IND_FUN, 15, 0, 0);
455 break; 511 break;
456 // case _NUM: 512 // case _NUM:
457 // rgbsps_set(LED_IND_NUM, 0, 0, 15); 513 // rgbsps_set(LED_IND_NUM, 0, 0, 15);
@@ -460,8 +516,8 @@ void led_set_layer_indicator(void) {
460 rgbsps_set(LED_IND_EMOJI, 15, 15, 0); 516 rgbsps_set(LED_IND_EMOJI, 15, 15, 0);
461 break; 517 break;
462 default: 518 default:
463 rgbsps_set(LED_IND_FUNC, 3, 3, 3); 519 rgbsps_set(LED_IND_FUN, 3, 3, 3);
464 rgbsps_set(LED_IND_NUM, 3, 3, 3); 520 // rgbsps_set(LED_IND_NUM, 3, 3, 3);
465 rgbsps_set(LED_IND_EMOJI, 3, 3, 3); 521 rgbsps_set(LED_IND_EMOJI, 3, 3, 3);
466 } 522 }
467 523
@@ -495,7 +551,7 @@ void led_init(void) {
495 rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); 551 rgbsps_set(LED_TRACKPOINT2, 0, 0, 15);
496 rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); 552 rgbsps_set(LED_TRACKPOINT3, 15, 0, 0);
497} 553}
498 554#endif // RGBSPS_ENABLE
499 555
500// keymaps 556// keymaps
501 557
@@ -509,14 +565,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
509 * |------+------+------+------+------+------|------+------+------+------+------+------| 565 * |------+------+------+------+------+------|------+------+------+------+------+------|
510 * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | 566 * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
511 * |------+------+------+------+------+------+------+------+------+------+------+------| 567 * |------+------+------+------+------+------+------+------+------+------+------+------|
512 * | Ctrl | Alt | GUI | Punc | Num | Space | Func |Greek | GUI |AltGr | Ctrl | 568 * | Ctrl | Alt | GUI | Punc | Num | Space | Fun |Greek | GUI |AltGr | Ctrl |
513 * `-----------------------------------------------------------------------------------' 569 * `-----------------------------------------------------------------------------------'
514 */ 570 */
515[_QWERTY] = KEYMAP( 571[_QWERTY] = KEYMAP(
516 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 572 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
517 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT , 573 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT ,
518 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, 574 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
519 KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, LSPACE, RSPACE, FUNC, GREEK, KC_RGUI, KC_RALT, KC_RCTL 575 KC_LCTL, KC_LALT, KC_LGUI, EMPTY, NUM, LSPACE, RSPACE, FUN, GREEK, KC_RGUI, KC_RALT, KC_RCTL
520), 576),
521 577
522/* Dvorak 578/* Dvorak
@@ -604,38 +660,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
604 660
605/* Punc 661/* Punc
606 * ,-----------------------------------------------------------------------------------. 662 * ,-----------------------------------------------------------------------------------.
607 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` | 663 * | ~ | ! | @ | # | $ | % | ^ | & | * | | | ` |
608 * |------+------+------+------+------+-------------+------+------+------+------+------| 664 * |------+------+------+------+------+-------------+------+------+------+------+------|
609 * | | * | \ | - | = | / | | ( | ) | < | > | | 665 * | | * | \ | - | = | / | | ( | ) | < | > | |
610 * |------+------+------+------+------+------|------+------+------+------+------+------| 666 * |------+------+------+------+------+------|------+------+------+------+------+------|
611 * | & | ^ | | | _ | + | ? | | [ | ] | { | } | : | 667 * | & | ^ | | | _ | + | ? | ± | [ | ] | { | } | : |
612 * |------+------+------+------+------+------+------+------+------+------+------+------| 668 * |------+------+------+------+------+------+------+------+------+------+------+------|
613 * | | | | | | | | | | | | 669 * | | | | | | | | | | | |
614 * `-----------------------------------------------------------------------------------' 670 * `-----------------------------------------------------------------------------------'
615 */ 671 */
616[_PUNC] = KEYMAP( 672[_PUNC] = KEYMAP(
617 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV , 673 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, X(LTEQ), X(GTEQ), _______,
618 XXXXXXX, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, XXXXXXX, KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, XXXXXXX, 674 KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, X(NOTEQ),KC_LPRN, KC_RPRN, KC_LABK, KC_RABK, _______,
619 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN, 675 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, X(PLMIN),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_COLN,
620 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 676 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
621), 677),
622 678
623/* Num 679/* Num
624 * ,-----------------------------------------------------------------------------------. 680 * ,-----------------------------------------------------------------------------------.
625 * | ~ | ! | @ | # | $ | % | A | 7 | 8 | 9 | D | ` | 681 * | ~ | ! | @ | # | $ | % | A | 7 | 8 | 9 | D | |
626 * |------+------+------+------+------+-------------+------+------+------+------+------| 682 * |------+------+------+------+------+-------------+------+------+------+------+------|
627 * | | * | \ | - | = | / | B | 4 | 5 | 6 | E | | 683 * | ` | * | \ | - | = | / | B | 4 | 5 | 6 | E | |
628 * |------+------+------+------+------+------|------+------+------+------+------+------| 684 * |------+------+------+------+------+------|------+------+------+------+------+------|
629 * | & | ^ | | | _ | + | ? | C | 1 | 2 | 3 | F | : | 685 * | & | ^ | | | _ | + | ? | C | 1 | 2 | 3 | F | : |
630 * |------+------+------+------+------+------+------+------+------+------+------+------| 686 * |------+------+------+------+------+------+------+------+------+------+------+------|
631 * | | | | | | | x | 0 | , | . | | | 687 * | | | | | | | | 0 | , | . | x | |
632 * `-----------------------------------------------------------------------------------' 688 * `-----------------------------------------------------------------------------------'
633 */ 689 */
634[_NUM] = KEYMAP( 690[_NUM] = KEYMAP(
635 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), KC_GRV, 691 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, S(KC_A), KC_7, KC_8, KC_9, S(KC_D), _______,
636 XXXXXXX, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______, 692 KC_GRV, KC_ASTR, KC_BSLS, KC_MINS, KC_EQL, KC_SLSH, S(KC_B), KC_4, KC_5, KC_6, S(KC_E), _______,
637 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), KC_COLN, 693 KC_AMPR, KC_CIRC, KC_PIPE, KC_UNDS, KC_PLUS, KC_QUES, S(KC_C), KC_1, KC_2, KC_3, S(KC_F), KC_COLN,
638 _______, _______, _______, _______, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_X, _______ 694 _______, _______, _______, _______, _______, _______, _______, FUN0 , KC_COMM, KC_DOT, KC_X, _______
639), 695),
640 696
641/* Func 697/* Func
@@ -649,11 +705,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
649 * | | | | | | | | | | | | 705 * | | | | | | | | | | | |
650 * `-----------------------------------------------------------------------------------' 706 * `-----------------------------------------------------------------------------------'
651 */ 707 */
652[_FUNC] = KEYMAP( 708[_FUN] = KEYMAP(
653 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL, 709 XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL,
654 XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS, 710 XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8, KC_PSCR, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS,
655 _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______, 711 _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______,
656 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 712 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
657), 713),
658 714
659/* Uppercase Greek 715/* Uppercase Greek
@@ -668,9 +724,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
668 * `-----------------------------------------------------------------------------------' 724 * `-----------------------------------------------------------------------------------'
669 */ 725 */
670[_GREEKU] = KEYMAP( 726[_GREEKU] = KEYMAP(
671 _______, _______, _______,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______, 727 _______, XXXXXXX, XXXXXXX,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______,
672 _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), _______, _______, 728 _______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), KC_QUOT, _______,
673 _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), _______, _______, _______, _______, 729 _______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), KC_COMM, KC_DOT, KC_SLSH, _______,
674 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 730 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
675), 731),
676 732
@@ -686,9 +742,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
686 * `-----------------------------------------------------------------------------------' 742 * `-----------------------------------------------------------------------------------'
687 */ 743 */
688[_GREEKL] = KEYMAP( 744[_GREEKL] = KEYMAP(
689 _______, _______,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______, 745 _______, XXXXXXX,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______,
690 _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), _______, _______, 746 _______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), KC_QUOT, _______,
691 _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), _______, _______, _______, _______, 747 _______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), KC_COMM, KC_DOT, KC_SLSH, _______,
748 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
749),
750
751/* Empty
752 * ,-----------------------------------------------------------------------------------.
753 * | | | | | | | | | | | | |
754 * |------+------+------+------+------+-------------+------+------+------+------+------|
755 * | | | | | | | | | | | | |
756 * |------+------+------+------+------+------+------+------+------+------+------+------|
757 * | | | | | | | | | | | | |
758 * |------+------+------+------+------+------+------+------+------+------+------+------|
759 * | | | | | | | | | | | | |
760 * `-----------------------------------------------------------------------------------'
761 */
762[_EMPTY] = KEYMAP(
763 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
764 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
765 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
692 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 766 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
693), 767),
694 768
@@ -707,14 +781,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
707 X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW), 781 X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW),
708 X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS), 782 X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS),
709 X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH), 783 X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH),
710 X(POO), X(EYES), _______,X(HUNRD), X(SKULL),X(HORNS), X(HALO), X(FEAR),X(YUMMY),_______,X(DISAP),X(NOEVK) 784 X(POO), X(EYES), X(HUNRD),_______, X(SKULL),X(HORNS), X(HALO), X(FEAR),_______,X(YUMMY),X(DISAP),X(NOEVK)
711), 785),
712 786
713/* GUI 787/* GUI
714 * ,-----------------------------------------------------------------------------------. 788 * ,-----------------------------------------------------------------------------------.
715 * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | | 789 * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
716 * |------+------+------+------+------+-------------+------+------+------+------+------| 790 * |------+------+------+------+------+-------------+------+------+------+------+------|
717 * | | | Vol- | Mute | Vol+ | | | Prev | | Next | | | 791 * | Esc | | Btab | Esc | Tab | | | Prev | | Next | | |
718 * |------+------+------+------+------+------+------+------+------+------+------+------| 792 * |------+------+------+------+------+------+------+------+------+------+------+------|
719 * | | | Prev | Play | Next | | | | | | | | 793 * | | | Prev | Play | Next | | | | | | | |
720 * |------+------+------+------+------+------+------+------+------+------+------+------| 794 * |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -723,9 +797,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
723 */ 797 */
724[_GUI] = KEYMAP( 798[_GUI] = KEYMAP(
725 XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX, 799 XXXXXXX, G(KC_1), G(KC_2), G(KC_3), G(KC_4), G(KC_5), G(KC_6), G(KC_7), G(KC_8), G(KC_9), G(KC_0), XXXXXXX,
726 XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX, 800 KC_ESC, XXXXXXX, S(KC_TAB),KC_ESC, KC_TAB, XXXXXXX, XXXXXXX, KC_WWWB, XXXXXXX, KC_WWWF, XXXXXXX, XXXXXXX,
727 XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, KC_SPC, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 801 XXXXXXX, XXXXXXX, KC_VOLD, KC_MUTE, KC_VOLU, KC_SPC, KC_SPC, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX,
728 XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX 802 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
729), 803),
730 804
731/* Sys 805/* Sys
@@ -741,11 +815,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
741 */ 815 */
742[_SYS] = KEYMAP( 816[_SYS] = KEYMAP(
743 XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 817 XXXXXXX, QWERTY, WIN, XXXXXXX, RESET, XXXXXXX, XXXXXXX, OUT_USB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
744 XXXXXXX, AUDIO, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX, 818 XXXXXXX, FC_TOG, XXXXXXX, DVORAK, XXXXXXX, GLOW, XXXXXXX, XXXXXXX, WORKMAN, LINUX, XXXXXXX, XXXXXXX,
745 XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, 819 XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, OUT_BLE, NORMAN, OSX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
746 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______ 820 _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______
747), 821),
748 822
823
749}; 824};
750 825
751void persistant_default_layer_set(uint16_t default_layer) { 826void persistant_default_layer_set(uint16_t default_layer) {
@@ -753,9 +828,63 @@ void persistant_default_layer_set(uint16_t default_layer) {
753 default_layer_set(default_layer); 828 default_layer_set(default_layer);
754} 829}
755 830
831#ifdef DOUBLESPACE_LAYER_ENABLE
832void process_doublespace(bool pressed, bool *isactive, bool *otheractive, bool *isemitted) {
833 if (pressed) {
834 *isactive = true;
835 if (*otheractive) {
836 layer_on(_SPACE);
837 register_code(KC_LALT); // sends alt and enter layer
838 space_layer_entered = true;
839 }
840 } else {
841 *isactive = false;
842 if (space_layer_entered) {
843 unregister_code(KC_LALT); // release alt and exit layer
844 layer_off(_SPACE);
845 if (!*otheractive) {
846 space_layer_entered = false;
847 }
848 } else {
849 if (!*isemitted) {
850 register_code(KC_SPC);
851 unregister_code(KC_SPC);
852 }
853 *isemitted = false;
854 }
855 }
856}
857#endif
858
859uint32_t layer_state_set_kb(uint32_t state)
860{
861 // turn on punc layer if both fun & num are on
862 if ((state & ((1UL<<_NUM) | (1UL<<_FUN))) == ((1UL<<_NUM) | (1UL<<_FUN))) {
863 state |= (1UL<<_PUNC);
864 } else {
865 state &= ~(1UL<<_PUNC);
866 }
867
868 // turn on emoji layer if empty and greek layer are on
869 if (
870 (state & ((1UL<<_EMPTY) | (1UL<<_GREEKU))) == ((1UL<<_EMPTY) | (1UL<<_GREEKU))
871 || (state & ((1UL<<_EMPTY) | (1UL<<_GREEKL))) == ((1UL<<_EMPTY) | (1UL<<_GREEKL))
872 ) {
873 state |= (1UL<<_EMOJI);
874 } else {
875 state &= ~(1UL<<_EMOJI);
876 }
877 return state;
878}
879
756bool process_record_user(uint16_t keycode, keyrecord_t *record) { 880bool process_record_user(uint16_t keycode, keyrecord_t *record) {
757 bool lshift = keyboard_report->mods & MOD_BIT(KC_LSFT); 881 static bool lshift = false;
758 bool rshift = keyboard_report->mods & MOD_BIT(KC_RSFT); 882 static bool rshift = false;
883 static uint8_t layer = 0;
884
885 lshift = keyboard_report->mods & MOD_BIT(KC_LSFT);
886 rshift = keyboard_report->mods & MOD_BIT(KC_RSFT);
887 layer = biton32(layer_state);
759 888
760#ifdef DOUBLESPACE_LAYER_ENABLE 889#ifdef DOUBLESPACE_LAYER_ENABLE
761 // double-space: send space immediately if any other key depressed before space is released 890 // double-space: send space immediately if any other key depressed before space is released
@@ -779,6 +908,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
779 rspace_emitted = true; 908 rspace_emitted = true;
780 } 909 }
781 } 910 }
911
912 if (layer == _SPACE && keycode != S(KC_TAB) && keycode != KC_TAB && keycode != KC_ESC && keycode != XXXXXXX) {
913 if (record->event.pressed) {
914 unregister_code(KC_LALT);
915 } else {
916 register_code(KC_LALT);
917 }
918 }
782#endif 919#endif
783 920
784 switch (keycode) { 921 switch (keycode) {
@@ -786,51 +923,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
786#ifdef DOUBLESPACE_LAYER_ENABLE 923#ifdef DOUBLESPACE_LAYER_ENABLE
787 // double-space enter space layer 924 // double-space enter space layer
788 case LSPACE: 925 case LSPACE:
789 if (record->event.pressed) { 926 process_doublespace(record->event.pressed, &lspace_active, &rspace_active, &lspace_emitted);
790 lspace_active = true;
791 if (rspace_active) {
792 layer_on(_SPACE);
793 space_layer_entered = true;
794 }
795 } else {
796 lspace_active = false;
797 if (space_layer_entered) {
798 layer_off(_SPACE);
799 if (!rspace_active) {
800 space_layer_entered = false;
801 }
802 } else {
803 if (!lspace_emitted) {
804 register_code(KC_SPC);
805 unregister_code(KC_SPC);
806 }
807 lspace_emitted = false;
808 }
809 }
810 return false; 927 return false;
811 break; 928 break;
812 case RSPACE: 929 case RSPACE:
813 if (record->event.pressed) { 930 process_doublespace(record->event.pressed, &rspace_active, &lspace_active, &rspace_emitted);
814 rspace_active = true;
815 if (lspace_active) {
816 layer_on(_SPACE);
817 space_layer_entered = true;
818 }
819 } else {
820 rspace_active = false;
821 if (space_layer_entered) {
822 layer_off(_SPACE);
823 if (!lspace_active) {
824 space_layer_entered = false;
825 }
826 } else {
827 if (!rspace_emitted) {
828 register_code(KC_SPC);
829 unregister_code(KC_SPC);
830 }
831 rspace_emitted = false;
832 }
833 }
834 return false; 931 return false;
835 break; 932 break;
836#endif 933#endif
@@ -840,7 +937,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
840 case KC_LSFT: 937 case KC_LSFT:
841 case KC_RSFT: 938 case KC_RSFT:
842 ; 939 ;
843 uint8_t layer = biton32(layer_state);
844 if (layer == _GREEKU || layer == _GREEKL) { 940 if (layer == _GREEKU || layer == _GREEKL) {
845 if (record->event.pressed) { 941 if (record->event.pressed) {
846 layer_on(_GREEKU); 942 layer_on(_GREEKU);
@@ -949,17 +1045,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
949#endif 1045#endif
950 1046
951 // layer switcher 1047 // layer switcher
952 case PUNC: 1048 //
953 if (record->event.pressed) {
954 layer_on(_PUNC);
955 update_tri_layer(_PUNC, _GREEKL, _EMOJI);
956 } else {
957 layer_off(_PUNC);
958 update_tri_layer(_PUNC, _GREEKL, _EMOJI);
959 }
960 return false;
961 break;
962
963 case GREEK: 1049 case GREEK:
964 if (record->event.pressed) { 1050 if (record->event.pressed) {
965 if (lshift || rshift) { 1051 if (lshift || rshift) {
@@ -968,31 +1054,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
968 } else { 1054 } else {
969 layer_on(_GREEKL); 1055 layer_on(_GREEKL);
970 layer_off(_GREEKU); 1056 layer_off(_GREEKU);
971 update_tri_layer(_PUNC, _GREEKL, _EMOJI);
972 } 1057 }
973 } else { 1058 } else {
974 layer_off(_GREEKU); 1059 layer_off(_GREEKU);
975 layer_off(_GREEKL); 1060 layer_off(_GREEKL);
976 update_tri_layer(_PUNC, _GREEKL, _EMOJI);
977 }
978 return false;
979 break;
980
981 case NUM:
982 if (record->event.pressed) {
983 turn_off_capslock();
984 layer_on(_NUM);
985 } else {
986 layer_off(_NUM);
987 }
988 return false;
989 break;
990
991 case FUNC:
992 if (record->event.pressed) {
993 layer_on(_FUNC);
994 } else {
995 layer_off(_FUNC);
996 } 1061 }
997 return false; 1062 return false;
998 break; 1063 break;
@@ -1012,6 +1077,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
1012 break; 1077 break;
1013 1078
1014 // glow mode changer 1079 // glow mode changer
1080#ifdef RGBSPS_ENABLE
1015 case GLOW: 1081 case GLOW:
1016 if (record->event.pressed) { 1082 if (record->event.pressed) {
1017 glow_mode++; 1083 glow_mode++;
@@ -1023,16 +1089,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
1023 } 1089 }
1024 return false; 1090 return false;
1025 break; 1091 break;
1092#endif
1026 1093
1027 // faux clicky toggle, TBD 1094 // faux clicky indicator
1028 case AUDIO: 1095#ifdef FAUXCLICKY_ENABLE
1029 return false; 1096 case FC_TOG:
1097 return true;
1030 break; 1098 break;
1099#endif
1031 } 1100 }
1032 return true; 1101 return true;
1033} 1102}
1034 1103
1035void set_output_user(uint8_t output) { 1104void set_output_user(uint8_t output) {
1105#ifdef ADAFRUIT_BLE_ENABLE
1036 switch(output) { 1106 switch(output) {
1037 case OUTPUT_USB: 1107 case OUTPUT_USB:
1038 led_set_output_usb(); 1108 led_set_output_usb();
@@ -1043,82 +1113,92 @@ void set_output_user(uint8_t output) {
1043 default: 1113 default:
1044 led_set_output_none(); 1114 led_set_output_none();
1045 } 1115 }
1116#endif
1046} 1117}
1047 1118
1048void matrix_init_user(void) { 1119void matrix_init_user() {
1049 _delay_ms(500); // give time for usb to initialize 1120 _delay_ms(500); // give time for usb to initialize
1050 1121
1051 set_unicode_input_mode(UC_LNX); 1122 set_unicode_input_mode(UC_LNX);
1123
1124#ifdef RGBSPS_ENABLE
1052 led_init(); 1125 led_init();
1126#endif
1053 1127
1054 // auto detect output on init 1128 // auto detect output on init
1129#ifdef ADAFRUIT_BLE_ENABLE
1055 uint8_t output = auto_detect_output(); 1130 uint8_t output = auto_detect_output();
1056 if (output == OUTPUT_USB) { 1131 if (output == OUTPUT_USB) {
1057 set_output(OUTPUT_USB); 1132 set_output(OUTPUT_USB);
1058 } else { 1133 } else {
1059 set_output(OUTPUT_ADAFRUIT_BLE); 1134 set_output(OUTPUT_ADAFRUIT_BLE);
1060 } 1135 }
1136#endif
1061} 1137}
1062 1138
1063void matrix_scan_user(void) { 1139void turn_off_capslock() {
1064 led_set_layer_indicator(); 1140 if (capslock) {
1141 register_code(KC_CAPS);
1142 unregister_code(KC_CAPS);
1143 }
1065} 1144}
1066 1145
1067void battery_poll(uint8_t level) { 1146#ifdef RGBSPS_ENABLE
1068 rgbsps_sethsv(LED_IND_BATTERY, level * 120/255, 255, 15); 1147 void matrix_scan_user(void) {
1069 rgbsps_send(); 1148 led_set_layer_indicator();
1070} 1149 }
1071 1150
1072void led_set_user(uint8_t usb_led) { 1151 void battery_poll(uint8_t level) {
1073 bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK); 1152 rgbsps_sethsv(LED_IND_BATTERY, level * 120/255, 255, 15);
1074 if (new_capslock ^ capslock) { // capslock state is different
1075 if (capslock = new_capslock) {
1076 rgbsps_set(LED_IND_NUM, 15, 0, 0);
1077 } else {
1078 rgbsps_set(LED_IND_NUM, 0, 0, 0);
1079 }
1080 rgbsps_send(); 1153 rgbsps_send();
1081 } 1154 }
1082}
1083 1155
1084void turn_off_capslock() { 1156 void led_set_user(uint8_t usb_led) {
1085 if (capslock) { 1157 bool new_capslock = usb_led & (1<<USB_LED_CAPS_LOCK);
1086 register_code(KC_CAPS); 1158 if (new_capslock ^ capslock) { // capslock state is different
1087 unregister_code(KC_CAPS); 1159 if ((capslock = new_capslock)) {
1160 rgbsps_set(LED_IND_NUM, 15, 0, 0);
1161 } else {
1162 rgbsps_set(LED_IND_NUM, 0, 0, 0);
1163 }
1164 rgbsps_send();
1165 }
1088 } 1166 }
1089} 1167#endif
1090 1168
1091void ps2_mouse_init_user() { 1169#ifdef PS2_MOUSE_ENABLE
1092 uint8_t rcv; 1170 void ps2_mouse_init_user() {
1093 1171 uint8_t rcv;
1094 // set TrackPoint sensitivity 1172
1095 PS2_MOUSE_SEND(0xE2, "tpsens: 0xE2"); 1173 // set TrackPoint sensitivity
1096 PS2_MOUSE_SEND(0x81, "tpsens: 0x81"); 1174 PS2_MOUSE_SEND(0xE2, "tpsens: 0xE2");
1097 PS2_MOUSE_SEND(0x4A, "tpsens: 0x4A"); 1175 PS2_MOUSE_SEND(0x81, "tpsens: 0x81");
1098 PS2_MOUSE_SEND(0x49, "tpsens: 0x59"); 1176 PS2_MOUSE_SEND(0x4A, "tpsens: 0x4A");
1099 1177 PS2_MOUSE_SEND(0x49, "tpsens: 0x59");
1100 // set TrackPoint Negative Inertia factor 1178
1101 PS2_MOUSE_SEND(0xE2, "tpnegin: 0xE2"); 1179 // set TrackPoint Negative Inertia factor
1102 PS2_MOUSE_SEND(0x81, "tpnegin: 0x81"); 1180 PS2_MOUSE_SEND(0xE2, "tpnegin: 0xE2");
1103 PS2_MOUSE_SEND(0x4D, "tpnegin: 0x4D"); 1181 PS2_MOUSE_SEND(0x81, "tpnegin: 0x81");
1104 PS2_MOUSE_SEND(0x06, "tpnegin: 0x06"); 1182 PS2_MOUSE_SEND(0x4D, "tpnegin: 0x4D");
1105 1183 PS2_MOUSE_SEND(0x06, "tpnegin: 0x06");
1106 // set TrackPoint speed 1184
1107 // (transfer function upper plateau speed) 1185 // set TrackPoint speed
1108 PS2_MOUSE_SEND(0xE2, "tpsp: 0xE2"); 1186 // (transfer function upper plateau speed)
1109 PS2_MOUSE_SEND(0x81, "tpsp: 0x81"); 1187 PS2_MOUSE_SEND(0xE2, "tpsp: 0xE2");
1110 PS2_MOUSE_SEND(0x60, "tpsp: 0x60"); 1188 PS2_MOUSE_SEND(0x81, "tpsp: 0x81");
1111 PS2_MOUSE_SEND(0x61, "tpsp: 0x61"); 1189 PS2_MOUSE_SEND(0x60, "tpsp: 0x60");
1112 1190 PS2_MOUSE_SEND(0x61, "tpsp: 0x61");
1113 // inquire pts status 1191
1114 rcv = ps2_host_send(0xE2); 1192 // inquire pts status
1115 rcv = ps2_host_send(0x2C);
1116 rcv = ps2_host_recv_response();
1117 if ((rcv & 1) == 1) {
1118 // if on, disable pts
1119 rcv = ps2_host_send(0xE2); 1193 rcv = ps2_host_send(0xE2);
1120 rcv = ps2_host_send(0x47);
1121 rcv = ps2_host_send(0x2C); 1194 rcv = ps2_host_send(0x2C);
1122 rcv = ps2_host_send(0x01); 1195 rcv = ps2_host_recv_response();
1123 } 1196 if ((rcv & 1) == 1) {
1124} \ No newline at end of file 1197 // if on, disable pts
1198 rcv = ps2_host_send(0xE2);
1199 rcv = ps2_host_send(0x47);
1200 rcv = ps2_host_send(0x2C);
1201 rcv = ps2_host_send(0x01);
1202 }
1203 }
1204#endif \ No newline at end of file
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/readme.md b/keyboards/handwired/promethium/keymaps/priyadi/readme.md
deleted file mode 100644
index e69de29bb..000000000
--- a/keyboards/handwired/promethium/keymaps/priyadi/readme.md
+++ /dev/null
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c
index 62e2281fa..4943f8c9f 100644
--- a/keyboards/handwired/promethium/promethium.c
+++ b/keyboards/handwired/promethium/promethium.c
@@ -36,3 +36,7 @@ void led_set_kb(uint8_t usb_led) {
36 led_set_user(usb_led); 36 led_set_user(usb_led);
37} 37}
38 38
39__attribute__ ((weak))
40void led_set_user(uint8_t usb_led) {
41}
42
diff --git a/keyboards/handwired/promethium/promethium.h b/keyboards/handwired/promethium/promethium.h
index da37e5c56..260f140c5 100644
--- a/keyboards/handwired/promethium/promethium.h
+++ b/keyboards/handwired/promethium/promethium.h
@@ -1,108 +1,10 @@
1#ifndef PROMETHIUM_H 1#ifndef PROMETHIUM_H
2#define PROMETHIUM_H 2#define PROMETHIUM_H
3 3
4#include "quantum.h" 4#include "stdint.h"
5 5
6#define PS2_INIT_DELAY 2000 6void battery_poll(uint8_t level);
7#define UNICODE_TYPE_DELAY 0 7void led_set_kb(uint8_t usb_led);
8#define BATTERY_PIN 9 8void led_set_user(uint8_t usb_led);
9#define BATTERY_POLL 30000
10#define MAX_VOLTAGE 4.2
11#define MIN_VOLTAGE 3.2
12
13#define KEYMAP( \
14 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
15 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
16 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
17 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
18) \
19{ \
20 {k11, k12, k13, k14, k15, k16}, \
21 {k21, k22, k23, k24, k25, k26}, \
22 {k31, k32, k33, k34, k35, k36}, \
23 {k41, k42, k43, k44, k45, k46}, \
24 {k17, k18, k19, k1a, k1b, k1c}, \
25 {k27, k28, k29, k2a, k2b, k2c}, \
26 {k37, k38, k39, k3a, k3b, k3c}, \
27 {k47, k48, k49, k4a, k4b, k4c} \
28}
29
30
31
32enum led_sequence {
33 LED_IND_BLUETOOTH,
34 LED_IND_USB,
35 LED_IND_BATTERY,
36
37 LED_IND_FUNC,
38 LED_IND_NUM,
39 LED_IND_EMOJI,
40
41 LED_BKSP,
42 LED_ENT,
43 LED_RSFT,
44 LED_RCTL,
45
46 LED_RGUI,
47 LED_SLSH,
48 LED_SCLN,
49 LED_P,
50
51 LED_O,
52 LED_L,
53 LED_DOT,
54 LED_RALT,
55
56 LED_EMOJI,
57 LED_COMM,
58 LED_K,
59 LED_I,
60
61 LED_U,
62 LED_J,
63 LED_M,
64 LED_FUNC,
65
66 LED_RSPC,
67 LED_N,
68 LED_HH,
69 LED_Y,
70
71 LED_TRACKPOINT3,
72 LED_TRACKPOINT2,
73 LED_TRACKPOINT1,
74
75 LED_LSPC,
76 LED_B,
77 LED_G,
78 LED_T,
79
80 LED_R,
81 LED_F,
82 LED_V,
83 LED_NUM,
84
85 LED_PUNC,
86 LED_C,
87 LED_D,
88 LED_E,
89
90 LED_W,
91 LED_S,
92 LED_X,
93 LED_LALT,
94
95 LED_LGUI,
96 LED_Z,
97 LED_A,
98 LED_Q,
99
100 LED_TAB,
101 LED_ESC,
102 LED_LSFT,
103 LED_LCTL,
104};
105 9
106#endif 10#endif
107
108void battery_poll(uint8_t level); \ No newline at end of file
diff --git a/keyboards/planck/keymaps/cbbrowne/config.h b/keyboards/planck/keymaps/cbbrowne/config.h
index bd15fd5a2..3a4ee907f 100644
--- a/keyboards/planck/keymaps/cbbrowne/config.h
+++ b/keyboards/planck/keymaps/cbbrowne/config.h
@@ -1,8 +1,12 @@
1#ifndef CONFIG_USER_H 1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H 2#define CONFIG_USER_H
3 3
4#ifndef NO_DEBUG
4#define NO_DEBUG 5#define NO_DEBUG
6#endif
7#ifndef NO_PRINT
5#define NO_PRINT 8#define NO_PRINT
9#endif
6 10
7#include "../../config.h" 11#include "../../config.h"
8 12
diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h
new file mode 100644
index 000000000..82e4a25c6
--- /dev/null
+++ b/keyboards/planck/keymaps/priyadi/config.h
@@ -0,0 +1,39 @@
1#ifndef CONFIG_USER_H
2#define CONFIG_USER_H
3
4#include "../../config.h"
5
6#define PRIYADI_PLANCK
7
8/* bootmagic salt key */
9#define BOOTMAGIC_KEY_SALT KC_ESC
10
11/* skip bootmagic and eeconfig */
12#define BOOTMAGIC_KEY_SKIP KC_SPACE
13
14#define PREVENT_STUCK_MODIFIERS
15
16#define UNICODE_TYPE_DELAY 0
17
18#define LAYOUT_DVORAK
19#define LAYOUT_COLEMAK
20#define LAYOUT_NORMAN
21#define LAYOUT_WORKMAN
22
23#define DOUBLESPACE_LAYER_ENABLE
24 // #define TOLELOT_ENABLE
25
26#define KEYMAP( \
27 k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \
28 k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
29 k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \
30 k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c \
31) \
32{ \
33 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c}, \
34 {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c}, \
35 {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c}, \
36 {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c} \
37}
38
39#endif
diff --git a/keyboards/planck/keymaps/priyadi/keymap.c b/keyboards/planck/keymaps/priyadi/keymap.c
index 13668fd10..bb3a2e92c 100644
--- a/keyboards/planck/keymaps/priyadi/keymap.c
+++ b/keyboards/planck/keymaps/priyadi/keymap.c
@@ -1,680 +1 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard, #include "../../../handwired/promethium/keymaps/priyadi/keymap.c" \ No newline at end of file
2// this is the style you want to emulate.
3
4#include "planck.h"
5#include "action_layer.h"
6#ifdef AUDIO_ENABLE
7 #include "audio.h"
8 #include "musical_notes.h"
9#endif
10#include "eeconfig.h"
11#include "process_unicode.h"
12#include "quantum.h"
13
14// #define TOLELOT_ENABLE
15
16extern keymap_config_t keymap_config;
17
18enum layers {
19 _QWERTY,
20 _COLEMAK,
21 _WORKMAN,
22 _PUNC,
23 _NUM,
24 _FUNC,
25 _EMOJI,
26 _GREEKU,
27 _GREEKL,
28 _GUI,
29};
30
31enum planck_keycodes {
32 // layouts
33 QWERTY = SAFE_RANGE,
34 COLEMAK,
35 WORKMAN,
36
37 // layer switchers
38 PUNC,
39 NUM,
40 FUNC,
41 EMOJI,
42 GUI,
43 GREEK,
44
45 // os switchers
46 LINUX,
47 WIN,
48 OSX,
49};
50
51// Fillers to make layering clearer
52
53#define _______ KC_TRNS
54#define XXXXXXX KC_NO
55
56// unicode map
57
58enum unicode_name {
59 GRIN, // grinning face 😊
60 TJOY, // tears of joy 😂
61 SMILE, // grining face with smiling eyes 😁
62 HEART, // heart ❤
63 EYERT, // smiling face with heart shaped eyes 😍
64 CRY, // crying face 😭
65 SMEYE, // smiling face with smiling eyes 😊
66 UNAMU, // unamused 😒
67 KISS, // kiss 😘
68 HART2, // two hearts 💕
69 WEARY, // weary 😩
70 OKHND, // ok hand sign 👌
71 PENSV, // pensive 😔
72 SMIRK, // smirk 😏
73 RECYC, // recycle ♻
74 WINK, // wink 😉
75 THMUP, // thumb up 👍
76 THMDN, // thumb down 👎
77 PRAY, // pray 🙏
78 PHEW, // relieved 😌
79 MUSIC, // musical notes
80 FLUSH, // flushed 😳
81 CELEB, // celebration 🙌
82 CRY2, // crying face 😢
83 COOL, // smile with sunglasses 😎
84 NOEVS, // see no evil
85 NOEVH, // hear no evil
86 NOEVK, // speak no evil
87 POO, // pile of poo
88 EYES, // eyes
89 VIC, // victory hand
90 BHART, // broken heart
91 SLEEP, // sleeping face
92 SMIL2, // smiling face with open mouth & sweat
93 HUNRD, // 100
94 CONFU, // confused
95 TONGU, // face with tongue & winking eye
96 DISAP, // disappointed
97 YUMMY, // face savoring delicious food
98 CLAP, // hand clapping
99 FEAR, // face screaming in fear
100 HORNS, // smiling face with horns
101 HALO, // smiling face with halo
102 BYE, // waving hand
103 SUN, // sun
104 MOON, // moon
105 SKULL, // skull
106
107 // greek letters
108 UALPH,
109 UBETA,
110 UGAMM,
111 UDELT,
112 UEPSI,
113 UZETA,
114 UETA,
115 UTHET,
116 UIOTA,
117 UKAPP,
118 ULAMB,
119 UMU,
120 UNU,
121 UXI,
122 UOMIC,
123 UPI,
124 URHO,
125 USIGM,
126 UTAU,
127 UUPSI,
128 UPHI,
129 UCHI,
130 UPSI,
131 UOMEG,
132
133 LALPH,
134 LBETA,
135 LGAMM,
136 LDELT,
137 LEPSI,
138 LZETA,
139 LETA,
140 LTHET,
141 LIOTA,
142 LKAPP,
143 LLAMB,
144 LMU,
145 LNU,
146 LXI,
147 LOMIC,
148 LPI,
149 LRHO,
150 LSIGM,
151 LTAU,
152 LUPSI,
153 LPHI,
154 LCHI,
155 LPSI,
156 LOMEG,
157
158 FSIGM,
159};
160
161const uint32_t PROGMEM unicode_map[] = {
162 [GRIN] = 0x1F600,
163 [TJOY] = 0x1F602,
164 [SMILE] = 0x1F601,
165 [HEART] = 0x2764,
166 [EYERT] = 0x1f60d,
167 [CRY] = 0x1f62d,
168 [SMEYE] = 0x1F60A,
169 [UNAMU] = 0x1F612,
170 [KISS] = 0x1F618,
171 [HART2] = 0x1F495,
172 [WEARY] = 0x1F629,
173 [OKHND] = 0x1F44C,
174 [PENSV] = 0x1F614,
175 [SMIRK] = 0x1F60F,
176 [RECYC] = 0x267B,
177 [WINK] = 0x1F609,
178 [THMUP] = 0x1F44D,
179 [THMDN] = 0x1F44E,
180 [PRAY] = 0x1F64F,
181 [PHEW] = 0x1F60C,
182 [MUSIC] = 0x1F3B6,
183 [FLUSH] = 0x1F633,
184 [CELEB] = 0x1F64C,
185 [CRY2] = 0x1F622,
186 [COOL] = 0x1F60E,
187 [NOEVS] = 0x1F648,
188 [NOEVH] = 0x1F649,
189 [NOEVK] = 0x1F64A,
190 [POO] = 0x1F4A9,
191 [EYES] = 0x1F440,
192 [VIC] = 0x270C,
193 [BHART] = 0x1F494,
194 [SLEEP] = 0x1F634,
195 [SMIL2] = 0x1F605,
196 [HUNRD] = 0x1F4AF,
197 [CONFU] = 0x1F615,
198 [TONGU] = 0x1F61C,
199 [DISAP] = 0x1F61E,
200 [YUMMY] = 0x1F60B,
201 [CLAP] = 0x1F44F,
202 [FEAR] = 0x1F631,
203 [HORNS] = 0x1F608,
204 [HALO] = 0x1F607,
205 [BYE] = 0x1F44B,
206 [SUN] = 0x2600,
207 [MOON] = 0x1F314,
208 [SKULL] = 0x1F480,
209
210 // greek letters
211 [UALPH] = 0x0391,
212 [UBETA] = 0x0392,
213 [UGAMM] = 0x0393,
214 [UDELT] = 0x0394,
215 [UEPSI] = 0x0395,
216 [UZETA] = 0x0396,
217 [UETA] = 0x0397,
218 [UTHET] = 0x0398,
219 [UIOTA] = 0x0399,
220 [UKAPP] = 0x039A,
221 [ULAMB] = 0x039B,
222 [UMU] = 0x039C,
223 [UNU] = 0x039D,
224 [UXI] = 0x039E,
225 [UOMIC] = 0x039F,
226 [UPI] = 0x03A0,
227 [URHO] = 0x03A1,
228 [USIGM] = 0x03A3,
229 [UTAU] = 0x03A4,
230 [UUPSI] = 0x03A5,
231 [UPHI] = 0x03A6,
232 [UCHI] = 0x03A7,
233 [UPSI] = 0x03A8,
234 [UOMEG] = 0x03A9,
235 [LALPH] = 0x03B1,
236 [LBETA] = 0x03B2,
237 [LGAMM] = 0x03B3,
238 [LDELT] = 0x03B4,
239 [LEPSI] = 0x03B5,
240 [LZETA] = 0x03B6,
241 [LETA] = 0x03B7,
242 [LTHET] = 0x03B8,
243 [LIOTA] = 0x03B9,
244 [LKAPP] = 0x03BA,
245 [LLAMB] = 0x03BB,
246 [LMU] = 0x03BC,
247 [LNU] = 0x03BD,
248 [LXI] = 0x03BE,
249 [LOMIC] = 0x03BF,
250 [LPI] = 0x03C0,
251 [LRHO] = 0x03C1,
252 [LSIGM] = 0x03C3,
253 [LTAU] = 0x03C4,
254 [LUPSI] = 0x03C5,
255 [LPHI] = 0x03C6,
256 [LCHI] = 0x03C7,
257 [LPSI] = 0x03C8,
258 [LOMEG] = 0x03C9,
259 [FSIGM] = 0x03C2,
260};
261
262
263// hybrid shift - =
264// #undef KC_LSFT
265// #define KC_LSFT MT(MOD_LSFT, KC_MINS)
266// #undef KC_RSFT
267// #define KC_RSFT MT(MOD_LSFT, KC_EQL)
268
269
270// hybrid right-gui & scroll lock (mapped to Compose in OS)
271#undef KC_RALT
272#define KC_RALT MT(MOD_RALT, KC_SLCK)
273
274// keymaps
275
276const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
277
278/* Qwerty
279 * ,-----------------------------------------------------------------------------------.
280 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
281 * |------+------+------+------+------+-------------+------+------+------+------+------|
282 * | Esc | A | S | D | F | G | H | J | K | L | ; |Enter |
283 * |------+------+------+------+------+------|------+------+------+------+------+------|
284 * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift |
285 * |------+------+------+------+------+------+------+------+------+------+------+------|
286 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |Greek |AltGr | Ctrl |
287 * `-----------------------------------------------------------------------------------'
288 */
289[_QWERTY] = {
290 {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
291 {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT },
292 {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT},
293 {KC_LCTL, KC_LALT, KC_LGUI, PUNC, NUM, KC_SPC, KC_SPC, FUNC, EMOJI, GREEK, KC_RALT, KC_RCTL}
294},
295
296/* Colemak
297 * ,-----------------------------------------------------------------------------------.
298 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
299 * |------+------+------+------+------+-------------+------+------+------+------+------|
300 * | Esc | A | R | S | T | D | H | N | E | I | O |Enter |
301 * |------+------+------+------+------+------|------+------+------+------+------+------|
302 * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift |
303 * |------+------+------+------+------+------+------+------+------+------+------+------|
304 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
305 * `-----------------------------------------------------------------------------------'
306 */
307[_COLEMAK] = {
308 {_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_QUOT, _______},
309 {_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, _______},
310 {_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
311 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
312},
313
314/* Workman
315 * ,-----------------------------------------------------------------------------------.
316 * | Tab | Q | D | R | W | B | J | F | U | P | ; | Bksp |
317 * |------+------+------+------+------+-------------+------+------+------+------+------|
318 * | Esc | A | S | H | T | G | Y | N | E | O | I |Enter |
319 * |------+------+------+------+------+------|------+------+------+------+------+------|
320 * | Shift| Z | X | M | C | V | K | K | , | . | / |Shift |
321 * |------+------+------+------+------+------+------+------+------+------+------+------|
322 * | Ctrl | GUI | Alt | Punc | Num | Space | Func |Emoji |AltGr | GUI | Ctrl |
323 * `-----------------------------------------------------------------------------------'
324 */
325[_WORKMAN] = {
326 {_______, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_QUOT, _______},
327 {_______, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, _______},
328 {_______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, _______},
329 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
330},
331
332/* Uppercase Greek
333 * ,-----------------------------------------------------------------------------------.
334 * | | | | | | | | | | | | |
335 * |------+------+------+------+------+-------------+------+------+------+------+------|
336 * | | | | | | | | | | | | |
337 * |------+------+------+------+------+------+------+------+------+------+------+------|
338 * | | | | | | | | | | | | |
339 * |------+------+------+------+------+------+------+------+------+------+------+------|
340 * | | | | | | | | | | | | |
341 * `-----------------------------------------------------------------------------------'
342 */
343[_GREEKU] = {
344 {_______, _______, _______,X(UEPSI), X(URHO), X(UTAU),X(UUPSI),X(UTHET),X(UIOTA),X(UOMIC), X(UPI), _______},
345 {_______,X(UALPH),X(USIGM),X(UDELT), X(UPHI),X(UGAMM), X(UETA), X(UXI),X(UKAPP),X(ULAMB), _______, _______},
346 {_______,X(UZETA), X(UCHI), X(UPSI),X(UOMEG),X(UBETA), X(UNU), X(UMU), _______, _______, _______, _______},
347 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
348},
349
350/* Lowercase Greek
351 * ,-----------------------------------------------------------------------------------.
352 * | | | | | | | | | | | | |
353 * |------+------+------+------+------+-------------+------+------+------+------+------|
354 * | | | | | | | | | | | | |
355 * |------+------+------+------+------+------+------+------+------+------+------+------|
356 * | | | | | | | | | | | | |
357 * |------+------+------+------+------+------+------+------+------+------+------+------|
358 * | | | | | | | | | | | | |
359 * `-----------------------------------------------------------------------------------'
360 */
361[_GREEKL] = {
362 {_______, _______,X(FSIGM),X(LEPSI), X(LRHO), X(LTAU),X(LUPSI),X(LTHET),X(LIOTA),X(LOMIC), X(LPI), _______},
363 {_______,X(LALPH),X(LSIGM),X(LDELT), X(LPHI),X(LGAMM), X(LETA), X(LXI),X(LKAPP),X(LLAMB), _______, _______},
364 {_______,X(LZETA), X(LCHI), X(LPSI),X(LOMEG),X(LBETA), X(LNU), X(LMU), _______, _______, _______, _______},
365 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
366},
367
368/* Punc
369 * ,-----------------------------------------------------------------------------------.
370 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | ` |
371 * |------+------+------+------+------+-------------+------+------+------+------+------|
372 * | | | \ | - | = | < | > | ( | ) | ' | | |
373 * |------+------+------+------+------+------|------+------+------+------+------+------|
374 * | | | | | _ | + | { | } | [ | ] | " | | |
375 * |------+------+------+------+------+------+------+------+------+------+------+------|
376 * | | | | | | | | | | | |
377 * `-----------------------------------------------------------------------------------'
378 */
379[_PUNC] = {
380 {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_GRV },
381 {XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LABK, KC_RABK, KC_LPRN, KC_RPRN, KC_QUOT, XXXXXXX, XXXXXXX},
382 {XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_DQUO, XXXXXXX, XXXXXXX},
383 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
384},
385
386/* Num
387 * ,-----------------------------------------------------------------------------------.
388 * | ^ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
389 * |------+------+------+------+------+-------------+------+------+------+------+------|
390 * | Esc | @ | A | B | C | ( | ) | 4 | 5 | 6 | : |Enter |
391 * |------+------+------+------+------+------|------+------+------+------+------+------|
392 * | & | # | D | E | F | [ | ] | 1 | 2 | 3 | / | * |
393 * |------+------+------+------+------+------+------+------+------+------+------+------|
394 * | | | | x | | | 0 | , | . | + | - |
395 * `-----------------------------------------------------------------------------------'
396 */
397[_NUM] = {
398 {KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
399 { KC_ESC, KC_AT, S(KC_A), S(KC_B), S(KC_C), KC_LPRN, KC_RPRN, KC_4, KC_5, KC_6, KC_COLN, KC_ENT},
400 {KC_AMPR, KC_HASH, S(KC_D), S(KC_E), S(KC_F), KC_LBRC, KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, KC_ASTR},
401 {_______, _______, _______, KC_X, _______, KC_SPC, KC_SPC, KC_0, KC_COMM, KC_DOT, KC_PLUS, KC_MINS}
402},
403
404/* Func
405 * ,-----------------------------------------------------------------------------------.
406 * | | F1 | F2 | F3 | F4 | | | PgUp | Up | PgDn | PgUp | Del |
407 * |------+------+------+------+------+-------------+------+------+------+------+------|
408 * | | F5 | F6 | F7 | F8 |PrtSc | | Left | Down | Right| PgDn | Ins |
409 * |------+------+------+------+------+------|------+------+------+------+------+------|
410 * | | F9 | F10 | F11 | F12 | | | | Home | End | | |
411 * |------+------+------+------+------+------+------+------+------+------+------+------|
412 * | | | | | | | | | | | |
413 * `-----------------------------------------------------------------------------------'
414 */
415[_FUNC] = {
416 {XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_PGUP, KC_DEL},
417 {XXXXXXX, KC_F5, KC_F6, KC_F7, KC_F8,KC_PSCREEN,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_INS},
418 {_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_END, XXXXXXX, _______},
419 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
420},
421
422/* Emoji
423 * ,-----------------------------------------------------------------------------------.
424 * | | | | | | | | | | | | |
425 * |------+------+------+------+------+-------------+------+------+------+------+------|
426 * | | | | | | | | | | | | |
427 * |------+------+------+------+------+------+------+------+------+------+------+------|
428 * | | | | | | | | | | | | |
429 * |------+------+------+------+------+------+------+------+------+------+------+------|
430 * | | | | | | | | | | | | |
431 * `-----------------------------------------------------------------------------------'
432 */
433[_EMOJI] = {
434 {X(HART2), X(CRY2),X(WEARY),X(EYERT),X(SMIRK), X(TJOY),X(RECYC),X(UNAMU),X(MUSIC),X(OKHND),X(PENSV), X(PHEW)},
435 {X(THMUP), X(PRAY),X(SMILE),X(SMIL2),X(FLUSH), X(GRIN),X(HEART), X(BYE), X(KISS),X(CELEB), X(COOL),X(NOEVS)},
436 {X(THMDN),X(SLEEP), X(CLAP), X(CRY), X(VIC),X(BHART), X(SUN),X(SMEYE), X(WINK), X(MOON),X(CONFU),X(NOEVH)},
437 { X(POO), X(EYES),X(HUNRD), _______,X(SKULL),X(HORNS), X(HALO), X(FEAR), _______,X(YUMMY),X(DISAP),X(NOEVK)}
438},
439
440/* GUI
441 * ,-----------------------------------------------------------------------------------.
442 * | | D1 | D2 | D3 | D4 | D5 | D6 | D7 | D8 | D9 | D10 | |
443 * |------+------+------+------+------+-------------+------+------+------+------+------|
444 * |Linux | | Vol- | Mute | Vol+ | | | D- | | D+ | |Qwerty|
445 * |------+------+------+------+------+------+------+------+------+------+------+------|
446 * | Win | | Prev | Play | Next | | | | | | |Colmak|
447 * |------+------+------+------+------+------+------+------+------+------+------+------|
448 * | OSX | | | | | BL- | BL+ | | | | |Workmn|
449 * `-----------------------------------------------------------------------------------'
450 */
451[_GUI] = {
452 {_______, LGUI(KC_1),LGUI(KC_2),LGUI(KC_3),LGUI(KC_4),LGUI(KC_5),LGUI(KC_6),LGUI(KC_7),LGUI(KC_8),LGUI(KC_9),LGUI(KC_0), _______},
453 { LINUX, _______, KC_VOLD, KC_MUTE, KC_VOLU,_______,_______,KC_WWW_BACK,_______,KC_WWW_FORWARD,_______, QWERTY},
454 { WIN, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, COLEMAK},
455 { OSX, _______, _______, _______, _______, BL_DEC, BL_INC, _______, _______, _______, _______, WORKMAN}
456},
457
458};
459
460#ifdef AUDIO_ENABLE
461float tone_startup[][2] = SONG(STARTUP_SOUND);
462float tone_qwerty[][2] = SONG(QWERTY_SOUND);
463float tone_colemak[][2] = SONG(COLEMAK_SOUND);
464float tone_workman[][2] = SONG(DVORAK_SOUND);
465float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
466float tone_linux[][2] = SONG(CAPS_LOCK_ON_SOUND);
467float tone_windows[][2] = SONG(SCROLL_LOCK_ON_SOUND);
468float tone_osx[][2] = SONG(NUM_LOCK_ON_SOUND);
469float tone_click[][2] = SONG(MUSICAL_NOTE(_F3, 2));
470float tone_release[][2] = SONG(MUSICAL_NOTE(_A3, 2));
471float tone_tolelot[][2] = SONG(Q__NOTE(_E5), Q__NOTE(_C5), Q__NOTE(_D5));
472#endif
473
474void persistant_default_layer_set(uint16_t default_layer) {
475 eeconfig_update_default_layer(default_layer);
476 default_layer_set(default_layer);
477}
478
479bool process_record_user(uint16_t keycode, keyrecord_t *record) {
480 // faux clicky
481 // if (record->event.pressed) PLAY_NOTE_ARRAY(tone_click, false, 0);
482 #ifdef AUDIO_ENABLE
483 #ifdef TOLELOT_ENABLE
484 if (record->event.pressed) {
485 PLAY_NOTE_ARRAY(tone_tolelot, false, 0);
486 }
487 #else
488 if (record->event.pressed) {
489 PLAY_NOTE_ARRAY(tone_click, false, 0);
490 } else {
491 PLAY_NOTE_ARRAY(tone_release, false, 0);
492 }
493 #endif
494 #endif
495
496 bool lshifted = keyboard_report->mods & MOD_BIT(KC_LSFT);
497 bool rshifted = keyboard_report->mods & MOD_BIT(KC_RSFT);
498
499 switch (keycode) {
500 // Greek layer handling
501 case GREEK:
502 if (record->event.pressed) {
503 if (lshifted || rshifted) {
504 layer_on(_GREEKU);
505 layer_off(_GREEKL);
506 } else {
507 layer_on(_GREEKL);
508 layer_off(_GREEKU);
509 }
510 } else {
511 layer_off(_GREEKU);
512 layer_off(_GREEKL);
513 }
514 return false;
515 break;
516
517 case KC_LSFT:
518 case KC_RSFT:
519 ;
520 uint8_t layer = biton32(layer_state);
521 if (layer == _GREEKU || layer == _GREEKL) {
522 if (record->event.pressed) {
523 layer_on(_GREEKU);
524 layer_off(_GREEKL);
525 } else {
526 if (lshifted ^ rshifted) { // if only one shift is pressed
527 layer_on(_GREEKL);
528 layer_off(_GREEKU);
529 }
530 }
531 }
532 return true;
533 break;
534
535 // QWERTZ style comma and dot: semicolon and colon when shifted
536 case KC_COMM:
537 if (record->event.pressed) {
538 if (lshifted || rshifted) {
539 if (lshifted) unregister_code(KC_LSFT);
540 if (rshifted) unregister_code(KC_RSFT);
541 register_code(KC_SCLN);
542 unregister_code(KC_SCLN);
543 if (lshifted) register_code(KC_LSFT);
544 if (rshifted) register_code(KC_RSFT);
545 } else {
546 register_code(KC_COMM);
547 unregister_code(KC_COMM);
548 }
549 }
550 return false;
551 break;
552 case KC_DOT:
553 if (record->event.pressed) {
554 if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) || (keyboard_report->mods & MOD_BIT(KC_RSFT))) {
555 register_code(KC_SCLN);
556 unregister_code(KC_SCLN);
557 } else {
558 register_code(KC_DOT);
559 unregister_code(KC_DOT);
560 }
561 }
562 return false;
563 break;
564
565 // layout switcher
566 case QWERTY:
567 if (record->event.pressed) {
568 #ifdef AUDIO_ENABLE
569 PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
570 #endif
571 persistant_default_layer_set(1UL<<_QWERTY);
572 }
573 return false;
574 break;
575 case COLEMAK:
576 if (record->event.pressed) {
577 #ifdef AUDIO_ENABLE
578 PLAY_NOTE_ARRAY(tone_colemak, false, 0);
579 #endif
580 persistant_default_layer_set(1UL<<_COLEMAK);
581 }
582 return false;
583 break;
584 case WORKMAN:
585 if (record->event.pressed) {
586 #ifdef AUDIO_ENABLE
587 PLAY_NOTE_ARRAY(tone_workman, false, 0);
588 #endif
589 persistant_default_layer_set(1UL<<_WORKMAN);
590 }
591 return false;
592 break;
593
594 // layer switchers
595 case PUNC:
596 if (record->event.pressed) {
597 layer_on(_PUNC);
598 update_tri_layer(_PUNC, _EMOJI, _GUI);
599 } else {
600 layer_off(_PUNC);
601 update_tri_layer(_PUNC, _EMOJI, _GUI);
602 }
603 return false;
604 break;
605 case EMOJI:
606 if (record->event.pressed) {
607 layer_on(_EMOJI);
608 update_tri_layer(_PUNC, _EMOJI, _GUI);
609 } else {
610 layer_off(_EMOJI);
611 update_tri_layer(_PUNC, _EMOJI, _GUI);
612 }
613 return false;
614 break;
615 case NUM:
616 if (record->event.pressed) {
617 layer_on(_NUM);
618 } else {
619 layer_off(_NUM);
620 }
621 return false;
622 break;
623 case FUNC:
624 if (record->event.pressed) {
625 layer_on(_FUNC);
626 } else {
627 layer_off(_FUNC);
628 }
629 return false;
630 break;
631
632 // OS switchers
633 case LINUX:
634 set_unicode_input_mode(UC_LNX);
635 #ifdef AUDIO_ENABLE
636 PLAY_NOTE_ARRAY(tone_linux, false, 0);
637 #endif
638 return false;
639 break;
640 case WIN:
641 set_unicode_input_mode(UC_WINC);
642 #ifdef AUDIO_ENABLE
643 PLAY_NOTE_ARRAY(tone_windows, false, 0);
644 #endif
645 return false;
646 break;
647 case OSX:
648 set_unicode_input_mode(UC_OSX);
649 #ifdef AUDIO_ENABLE
650 PLAY_NOTE_ARRAY(tone_osx, false, 0);
651 #endif
652 return false;
653 break;
654 }
655 return true;
656}
657
658void matrix_init_user(void) {
659 #ifdef AUDIO_ENABLE
660 startup_user();
661 #endif
662 set_unicode_input_mode(UC_LNX);
663}
664
665#ifdef AUDIO_ENABLE
666
667void startup_user()
668{
669 _delay_ms(20); // gets rid of tick
670 PLAY_NOTE_ARRAY(tone_startup, false, 0);
671}
672
673void shutdown_user()
674{
675 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
676 _delay_ms(150);
677 stop_all_notes();
678}
679
680#endif \ No newline at end of file
diff --git a/keyboards/planck/keymaps/unicode/keymap.c b/keyboards/planck/keymaps/unicode/keymap.c
index d73e7e09d..1b4ca8ed7 100644
--- a/keyboards/planck/keymaps/unicode/keymap.c
+++ b/keyboards/planck/keymaps/unicode/keymap.c
@@ -195,24 +195,20 @@ const uint16_t PROGMEM fn_actions[] = {
195}; 195};
196 196
197#ifdef AUDIO_ENABLE 197#ifdef AUDIO_ENABLE
198float tone_startup[][2] = {
199 {440.0*pow(2.0,(31)/12.0), 12},
200 {440.0*pow(2.0,(28)/12.0), 8},
201 {440.0*pow(2.0,(19)/12.0), 8},
202 {440.0*pow(2.0,(24)/12.0), 8},
203 {440.0*pow(2.0,(28)/12.0), 20}
204};
205 198
199float tone_startup[][2] = SONG(STARTUP_SOUND);
206float tone_qwerty[][2] = SONG(QWERTY_SOUND); 200float tone_qwerty[][2] = SONG(QWERTY_SOUND);
207float tone_dvorak[][2] = SONG(DVORAK_SOUND); 201float tone_dvorak[][2] = SONG(DVORAK_SOUND);
208float tone_colemak[][2] = SONG(COLEMAK_SOUND); 202float tone_colemak[][2] = SONG(COLEMAK_SOUND);
209float tone_plover[][2] = SONG(PLOVER_SOUND); 203float tone_plover[][2] = SONG(PLOVER_SOUND);
210float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); 204float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
205float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
211 206
212float goodbye[][2] = SONG(GOODBYE_SOUND); 207float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
213#endif 208#endif
214 209
215 210
211
216void persistant_default_layer_set(uint16_t default_layer) { 212void persistant_default_layer_set(uint16_t default_layer) {
217 eeconfig_update_default_layer(default_layer); 213 eeconfig_update_default_layer(default_layer);
218 default_layer_set(default_layer); 214 default_layer_set(default_layer);
@@ -309,18 +305,35 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
309}; 305};
310 306
311void matrix_init_user(void) { 307void matrix_init_user(void) {
312 #ifdef AUDIO_ENABLE 308 #ifdef AUDIO_ENABLE
313 _delay_ms(20); // stops the tick 309 startup_user();
314 PLAY_NOTE_ARRAY(tone_startup, false, 0); 310 #endif
315 #endif
316} 311}
317 312
318#ifdef AUDIO_ENABLE 313#ifdef AUDIO_ENABLE
319void play_goodbye_tone() 314
315void startup_user()
320{ 316{
321 PLAY_NOTE_ARRAY(goodbye, false, 0); 317 _delay_ms(20); // gets rid of tick
322 _delay_ms(150); 318 PLAY_NOTE_ARRAY(tone_startup, false, 0);
319}
320
321void shutdown_user()
322{
323 PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
324 _delay_ms(150);
325 stop_all_notes();
326}
327
328void music_on_user(void)
329{
330 music_scale_user();
323} 331}
324#endif
325 332
333void music_scale_user(void)
334{
335 PLAY_NOTE_ARRAY(music_scale, false, 0);
336}
337
338#endif
326 339
diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c
index 8326e91ea..c2edb75f0 100644
--- a/quantum/audio/voices.c
+++ b/quantum/audio/voices.c
@@ -24,6 +24,7 @@ void voice_deiterate() {
24 24
25float voice_envelope(float frequency) { 25float voice_envelope(float frequency) {
26 // envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz 26 // envelope_index ranges from 0 to 0xFFFF, which is preserved at 880.0 Hz
27 __attribute__ ((unused))
27 uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency)); 28 uint16_t compensated_index = (uint16_t)((float)envelope_index * (880.0 / frequency));
28 29
29 switch (voice) { 30 switch (voice) {
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 54b872d49..002eabd85 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -119,6 +119,9 @@ action_t action_for_key(uint8_t layer, keypos_t key)
119 mod = keycode & 0xFF; 119 mod = keycode & 0xFF;
120 action.code = ACTION_MODS_ONESHOT(mod); 120 action.code = ACTION_MODS_ONESHOT(mod);
121 break; 121 break;
122 case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
123 action.code = ACTION_LAYER_TAP_TOGGLE(keycode & 0xFF);
124 break;
122 case QK_MOD_TAP ... QK_MOD_TAP_MAX: 125 case QK_MOD_TAP ... QK_MOD_TAP_MAX:
123 action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF); 126 action.code = ACTION_MODS_TAP_KEY((keycode >> 0x8) & 0x1F, keycode & 0xFF);
124 break; 127 break;
diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h
index 834c69650..401bbdf64 100644
--- a/quantum/keymap_extras/keymap_french.h
+++ b/quantum/keymap_extras/keymap_french.h
@@ -4,7 +4,9 @@
4#include "keymap.h" 4#include "keymap.h"
5 5
6// Alt gr 6// Alt gr
7#ifndef ALGR
7#define ALGR(kc) RALT(kc) 8#define ALGR(kc) RALT(kc)
9#endif
8#define NO_ALGR KC_RALT 10#define NO_ALGR KC_RALT
9 11
10// Normal characters 12// Normal characters
@@ -72,7 +74,7 @@
72#define FR_PIPE ALGR(KC_6) 74#define FR_PIPE ALGR(KC_6)
73#define FR_GRV ALGR(KC_7) 75#define FR_GRV ALGR(KC_7)
74#define FR_BSLS ALGR(KC_8) 76#define FR_BSLS ALGR(KC_8)
75#define FR_CIRC ALGR(KC_9) 77#define FR_CCIRC ALGR(KC_9)
76#define FR_AT ALGR(KC_0) 78#define FR_AT ALGR(KC_0)
77#define FR_RBRC ALGR(FR_RPRN) 79#define FR_RBRC ALGR(FR_RPRN)
78#define FR_RCBR ALGR(FR_EQL) 80#define FR_RCBR ALGR(FR_EQL)
diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c
new file mode 100644
index 000000000..4ad2533b0
--- /dev/null
+++ b/quantum/process_keycode/process_ucis.c
@@ -0,0 +1,133 @@
1#include "process_ucis.h"
2
3qk_ucis_state_t qk_ucis_state;
4
5void qk_ucis_start(void) {
6 qk_ucis_state.count = 0;
7 qk_ucis_state.in_progress = true;
8
9 qk_ucis_start_user();
10}
11
12__attribute__((weak))
13void qk_ucis_start_user(void) {
14 unicode_input_start();
15 register_hex(0x2328);
16 unicode_input_finish();
17}
18
19static bool is_uni_seq(char *seq) {
20 uint8_t i;
21
22 for (i = 0; seq[i]; i++) {
23 uint16_t code;
24 if (('1' <= seq[i]) && (seq[i] <= '0'))
25 code = seq[i] - '1' + KC_1;
26 else
27 code = seq[i] - 'a' + KC_A;
28
29 if (i > qk_ucis_state.count || qk_ucis_state.codes[i] != code)
30 return false;
31 }
32
33 return (qk_ucis_state.codes[i] == KC_ENT ||
34 qk_ucis_state.codes[i] == KC_SPC);
35}
36
37__attribute__((weak))
38void qk_ucis_symbol_fallback (void) {
39 for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) {
40 uint8_t code = qk_ucis_state.codes[i];
41 register_code(code);
42 unregister_code(code);
43 wait_ms(UNICODE_TYPE_DELAY);
44 }
45}
46
47void register_ucis(const char *hex) {
48 for(int i = 0; hex[i]; i++) {
49 uint8_t kc = 0;
50 char c = hex[i];
51
52 switch (c) {
53 case '0':
54 kc = KC_0;
55 break;
56 case '1' ... '9':
57 kc = c - '1' + KC_1;
58 break;
59 case 'a' ... 'f':
60 kc = c - 'a' + KC_A;
61 break;
62 case 'A' ... 'F':
63 kc = c - 'A' + KC_A;
64 break;
65 }
66
67 if (kc) {
68 register_code (kc);
69 unregister_code (kc);
70 wait_ms (UNICODE_TYPE_DELAY);
71 }
72 }
73}
74
75bool process_ucis (uint16_t keycode, keyrecord_t *record) {
76 uint8_t i;
77
78 if (!qk_ucis_state.in_progress)
79 return true;
80
81 if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH &&
82 !(keycode == KC_BSPC || keycode == KC_ESC || keycode == KC_SPC || keycode == KC_ENT)) {
83 return false;
84 }
85
86 if (!record->event.pressed)
87 return true;
88
89 qk_ucis_state.codes[qk_ucis_state.count] = keycode;
90 qk_ucis_state.count++;
91
92 if (keycode == KC_BSPC) {
93 if (qk_ucis_state.count >= 2) {
94 qk_ucis_state.count -= 2;
95 return true;
96 } else {
97 qk_ucis_state.count--;
98 return false;
99 }
100 }
101
102 if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) {
103 bool symbol_found = false;
104
105 for (i = qk_ucis_state.count; i > 0; i--) {
106 register_code (KC_BSPC);
107 unregister_code (KC_BSPC);
108 wait_ms(UNICODE_TYPE_DELAY);
109 }
110
111 if (keycode == KC_ESC) {
112 qk_ucis_state.in_progress = false;
113 return false;
114 }
115
116 unicode_input_start();
117 for (i = 0; ucis_symbol_table[i].symbol; i++) {
118 if (is_uni_seq (ucis_symbol_table[i].symbol)) {
119 symbol_found = true;
120 register_ucis(ucis_symbol_table[i].code + 2);
121 break;
122 }
123 }
124 if (!symbol_found) {
125 qk_ucis_symbol_fallback();
126 }
127 unicode_input_finish();
128
129 qk_ucis_state.in_progress = false;
130 return false;
131 }
132 return true;
133} \ No newline at end of file
diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h
new file mode 100644
index 000000000..4332f57b3
--- /dev/null
+++ b/quantum/process_keycode/process_ucis.h
@@ -0,0 +1,35 @@
1#ifndef PROCESS_UCIS_H
2#define PROCESS_UCIS_H
3
4#include "quantum.h"
5#include "process_unicode_common.h"
6
7#ifndef UCIS_MAX_SYMBOL_LENGTH
8#define UCIS_MAX_SYMBOL_LENGTH 32
9#endif
10
11typedef struct {
12 char *symbol;
13 char *code;
14} qk_ucis_symbol_t;
15
16typedef struct {
17 uint8_t count;
18 uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
19 bool in_progress:1;
20} qk_ucis_state_t;
21
22extern qk_ucis_state_t qk_ucis_state;
23
24#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}}
25#define UCIS_SYM(name, code) {name, #code}
26
27extern const qk_ucis_symbol_t ucis_symbol_table[];
28
29void qk_ucis_start(void);
30void qk_ucis_start_user(void);
31void qk_ucis_symbol_fallback (void);
32void register_ucis(const char *hex);
33bool process_ucis (uint16_t keycode, keyrecord_t *record);
34
35#endif
diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c
index 9d01a592d..ccae6fdca 100644
--- a/quantum/process_keycode/process_unicode.c
+++ b/quantum/process_keycode/process_unicode.c
@@ -1,103 +1,6 @@
1#include "process_unicode.h" 1#include "process_unicode.h"
2#include "action_util.h" 2#include "action_util.h"
3 3
4static uint8_t input_mode;
5uint8_t mods;
6
7__attribute__((weak))
8uint16_t hex_to_keycode(uint8_t hex)
9{
10 if (hex == 0x0) {
11 return KC_0;
12 } else if (hex < 0xA) {
13 return KC_1 + (hex - 0x1);
14 } else {
15 return KC_A + (hex - 0xA);
16 }
17}
18
19void set_unicode_input_mode(uint8_t os_target)
20{
21 input_mode = os_target;
22}
23
24uint8_t get_unicode_input_mode(void) {
25 return input_mode;
26}
27
28__attribute__((weak))
29void unicode_input_start (void) {
30 // save current mods
31 mods = keyboard_report->mods;
32
33 // unregister all mods to start from clean state
34 if (mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT);
35 if (mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT);
36 if (mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL);
37 if (mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL);
38 if (mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT);
39 if (mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT);
40 if (mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI);
41 if (mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI);
42
43 switch(input_mode) {
44 case UC_OSX:
45 register_code(KC_LALT);
46 break;
47 case UC_LNX:
48 register_code(KC_LCTL);
49 register_code(KC_LSFT);
50 register_code(KC_U);
51 unregister_code(KC_U);
52 unregister_code(KC_LSFT);
53 unregister_code(KC_LCTL);
54 break;
55 case UC_WIN:
56 register_code(KC_LALT);
57 register_code(KC_PPLS);
58 unregister_code(KC_PPLS);
59 break;
60 case UC_WINC:
61 register_code(KC_RALT);
62 unregister_code(KC_RALT);
63 register_code(KC_U);
64 unregister_code(KC_U);
65 }
66 wait_ms(UNICODE_TYPE_DELAY);
67}
68
69__attribute__((weak))
70void unicode_input_finish (void) {
71 switch(input_mode) {
72 case UC_OSX:
73 case UC_WIN:
74 unregister_code(KC_LALT);
75 break;
76 case UC_LNX:
77 register_code(KC_SPC);
78 unregister_code(KC_SPC);
79 break;
80 }
81
82 // reregister previously set mods
83 if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT);
84 if (mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT);
85 if (mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL);
86 if (mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL);
87 if (mods & MOD_BIT(KC_LALT)) register_code(KC_LALT);
88 if (mods & MOD_BIT(KC_RALT)) register_code(KC_RALT);
89 if (mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI);
90 if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI);
91}
92
93void register_hex(uint16_t hex) {
94 for(int i = 3; i >= 0; i--) {
95 uint8_t digit = ((hex >> (i*4)) & 0xF);
96 register_code(hex_to_keycode(digit));
97 unregister_code(hex_to_keycode(digit));
98 }
99}
100
101bool process_unicode(uint16_t keycode, keyrecord_t *record) { 4bool process_unicode(uint16_t keycode, keyrecord_t *record) {
102 if (keycode > QK_UNICODE && record->event.pressed) { 5 if (keycode > QK_UNICODE && record->event.pressed) {
103 uint16_t unicode = keycode & 0x7FFF; 6 uint16_t unicode = keycode & 0x7FFF;
@@ -108,191 +11,3 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record) {
108 return true; 11 return true;
109} 12}
110 13
111#ifdef UNICODEMAP_ENABLE
112__attribute__((weak))
113const uint32_t PROGMEM unicode_map[] = {
114};
115
116void register_hex32(uint32_t hex) {
117 uint8_t onzerostart = 1;
118 for(int i = 7; i >= 0; i--) {
119 if (i <= 3) {
120 onzerostart = 0;
121 }
122 uint8_t digit = ((hex >> (i*4)) & 0xF);
123 if (digit == 0) {
124 if (onzerostart == 0) {
125 register_code(hex_to_keycode(digit));
126 unregister_code(hex_to_keycode(digit));
127 }
128 } else {
129 register_code(hex_to_keycode(digit));
130 unregister_code(hex_to_keycode(digit));
131 onzerostart = 0;
132 }
133 }
134}
135
136__attribute__((weak))
137void unicode_map_input_error() {}
138
139bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
140 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
141 const uint32_t* map = unicode_map;
142 uint16_t index = keycode - QK_UNICODE_MAP;
143 uint32_t code = pgm_read_dword_far(&map[index]);
144 if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
145 // Convert to UTF-16 surrogate pair
146 code -= 0x10000;
147 uint32_t lo = code & 0x3ff;
148 uint32_t hi = (code & 0xffc00) >> 10;
149 unicode_input_start();
150 register_hex32(hi + 0xd800);
151 register_hex32(lo + 0xdc00);
152 unicode_input_finish();
153 } else if ((code > 0x10ffff && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) {
154 // when character is out of range supported by the OS
155 unicode_map_input_error();
156 } else {
157 unicode_input_start();
158 register_hex32(code);
159 unicode_input_finish();
160 }
161 }
162 return true;
163}
164#endif
165
166#ifdef UCIS_ENABLE
167qk_ucis_state_t qk_ucis_state;
168
169void qk_ucis_start(void) {
170 qk_ucis_state.count = 0;
171 qk_ucis_state.in_progress = true;
172
173 qk_ucis_start_user();
174}
175
176__attribute__((weak))
177void qk_ucis_start_user(void) {
178 unicode_input_start();
179 register_hex(0x2328);
180 unicode_input_finish();
181}
182
183static bool is_uni_seq(char *seq) {
184 uint8_t i;
185
186 for (i = 0; seq[i]; i++) {
187 uint16_t code;
188 if (('1' <= seq[i]) && (seq[i] <= '0'))
189 code = seq[i] - '1' + KC_1;
190 else
191 code = seq[i] - 'a' + KC_A;
192
193 if (i > qk_ucis_state.count || qk_ucis_state.codes[i] != code)
194 return false;
195 }
196
197 return (qk_ucis_state.codes[i] == KC_ENT ||
198 qk_ucis_state.codes[i] == KC_SPC);
199}
200
201__attribute__((weak))
202void qk_ucis_symbol_fallback (void) {
203 for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) {
204 uint8_t code = qk_ucis_state.codes[i];
205 register_code(code);
206 unregister_code(code);
207 wait_ms(UNICODE_TYPE_DELAY);
208 }
209}
210
211void register_ucis(const char *hex) {
212 for(int i = 0; hex[i]; i++) {
213 uint8_t kc = 0;
214 char c = hex[i];
215
216 switch (c) {
217 case '0':
218 kc = KC_0;
219 break;
220 case '1' ... '9':
221 kc = c - '1' + KC_1;
222 break;
223 case 'a' ... 'f':
224 kc = c - 'a' + KC_A;
225 break;
226 case 'A' ... 'F':
227 kc = c - 'A' + KC_A;
228 break;
229 }
230
231 if (kc) {
232 register_code (kc);
233 unregister_code (kc);
234 wait_ms (UNICODE_TYPE_DELAY);
235 }
236 }
237}
238
239bool process_ucis (uint16_t keycode, keyrecord_t *record) {
240 uint8_t i;
241
242 if (!qk_ucis_state.in_progress)
243 return true;
244
245 if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH &&
246 !(keycode == KC_BSPC || keycode == KC_ESC || keycode == KC_SPC || keycode == KC_ENT)) {
247 return false;
248 }
249
250 if (!record->event.pressed)
251 return true;
252
253 qk_ucis_state.codes[qk_ucis_state.count] = keycode;
254 qk_ucis_state.count++;
255
256 if (keycode == KC_BSPC) {
257 if (qk_ucis_state.count >= 2) {
258 qk_ucis_state.count -= 2;
259 return true;
260 } else {
261 qk_ucis_state.count--;
262 return false;
263 }
264 }
265
266 if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) {
267 bool symbol_found = false;
268
269 for (i = qk_ucis_state.count; i > 0; i--) {
270 register_code (KC_BSPC);
271 unregister_code (KC_BSPC);
272 wait_ms(UNICODE_TYPE_DELAY);
273 }
274
275 if (keycode == KC_ESC) {
276 qk_ucis_state.in_progress = false;
277 return false;
278 }
279
280 unicode_input_start();
281 for (i = 0; ucis_symbol_table[i].symbol; i++) {
282 if (is_uni_seq (ucis_symbol_table[i].symbol)) {
283 symbol_found = true;
284 register_ucis(ucis_symbol_table[i].code + 2);
285 break;
286 }
287 }
288 if (!symbol_found) {
289 qk_ucis_symbol_fallback();
290 }
291 unicode_input_finish();
292
293 qk_ucis_state.in_progress = false;
294 return false;
295 }
296 return true;
297}
298#endif
diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h
index f17cfa6cf..4c21f11eb 100644
--- a/quantum/process_keycode/process_unicode.h
+++ b/quantum/process_keycode/process_unicode.h
@@ -2,166 +2,8 @@
2#define PROCESS_UNICODE_H 2#define PROCESS_UNICODE_H
3 3
4#include "quantum.h" 4#include "quantum.h"
5 5#include "process_unicode_common.h"
6#define UC_OSX 0 // Mac OS X
7#define UC_LNX 1 // Linux
8#define UC_WIN 2 // Windows 'HexNumpad'
9#define UC_BSD 3 // BSD (not implemented)
10#define UC_WINC 4 // WinCompose https://github.com/samhocevar/wincompose
11
12#ifndef UNICODE_TYPE_DELAY
13#define UNICODE_TYPE_DELAY 10
14#endif
15
16void set_unicode_input_mode(uint8_t os_target);
17uint8_t get_unicode_input_mode(void);
18void unicode_input_start(void);
19void unicode_input_finish(void);
20void register_hex(uint16_t hex);
21 6
22bool process_unicode(uint16_t keycode, keyrecord_t *record); 7bool process_unicode(uint16_t keycode, keyrecord_t *record);
23 8
24#ifdef UNICODEMAP_ENABLE
25void unicode_map_input_error(void);
26bool process_unicode_map(uint16_t keycode, keyrecord_t *record);
27#endif
28
29#ifdef UCIS_ENABLE
30#ifndef UCIS_MAX_SYMBOL_LENGTH
31#define UCIS_MAX_SYMBOL_LENGTH 32
32#endif
33
34typedef struct {
35 char *symbol;
36 char *code;
37} qk_ucis_symbol_t;
38
39typedef struct {
40 uint8_t count;
41 uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
42 bool in_progress:1;
43} qk_ucis_state_t;
44
45extern qk_ucis_state_t qk_ucis_state;
46
47#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}}
48#define UCIS_SYM(name, code) {name, #code}
49
50extern const qk_ucis_symbol_t ucis_symbol_table[];
51
52void qk_ucis_start(void);
53void qk_ucis_start_user(void);
54void qk_ucis_symbol_fallback (void);
55void register_ucis(const char *hex);
56bool process_ucis (uint16_t keycode, keyrecord_t *record);
57
58#endif
59
60#define UC_BSPC UC(0x0008)
61
62#define UC_SPC UC(0x0020)
63
64#define UC_EXLM UC(0x0021)
65#define UC_DQUT UC(0x0022)
66#define UC_HASH UC(0x0023)
67#define UC_DLR UC(0x0024)
68#define UC_PERC UC(0x0025)
69#define UC_AMPR UC(0x0026)
70#define UC_QUOT UC(0x0027)
71#define UC_LPRN UC(0x0028)
72#define UC_RPRN UC(0x0029)
73#define UC_ASTR UC(0x002A)
74#define UC_PLUS UC(0x002B)
75#define UC_COMM UC(0x002C)
76#define UC_DASH UC(0x002D)
77#define UC_DOT UC(0x002E)
78#define UC_SLSH UC(0x002F)
79
80#define UC_0 UC(0x0030)
81#define UC_1 UC(0x0031)
82#define UC_2 UC(0x0032)
83#define UC_3 UC(0x0033)
84#define UC_4 UC(0x0034)
85#define UC_5 UC(0x0035)
86#define UC_6 UC(0x0036)
87#define UC_7 UC(0x0037)
88#define UC_8 UC(0x0038)
89#define UC_9 UC(0x0039)
90
91#define UC_COLN UC(0x003A)
92#define UC_SCLN UC(0x003B)
93#define UC_LT UC(0x003C)
94#define UC_EQL UC(0x003D)
95#define UC_GT UC(0x003E)
96#define UC_QUES UC(0x003F)
97#define UC_AT UC(0x0040)
98
99#define UC_A UC(0x0041)
100#define UC_B UC(0x0042)
101#define UC_C UC(0x0043)
102#define UC_D UC(0x0044)
103#define UC_E UC(0x0045)
104#define UC_F UC(0x0046)
105#define UC_G UC(0x0047)
106#define UC_H UC(0x0048)
107#define UC_I UC(0x0049)
108#define UC_J UC(0x004A)
109#define UC_K UC(0x004B)
110#define UC_L UC(0x004C)
111#define UC_M UC(0x004D)
112#define UC_N UC(0x004E)
113#define UC_O UC(0x004F)
114#define UC_P UC(0x0050)
115#define UC_Q UC(0x0051)
116#define UC_R UC(0x0052)
117#define UC_S UC(0x0053)
118#define UC_T UC(0x0054)
119#define UC_U UC(0x0055)
120#define UC_V UC(0x0056)
121#define UC_W UC(0x0057)
122#define UC_X UC(0x0058)
123#define UC_Y UC(0x0059)
124#define UC_Z UC(0x005A)
125
126#define UC_LBRC UC(0x005B)
127#define UC_BSLS UC(0x005C)
128#define UC_RBRC UC(0x005D)
129#define UC_CIRM UC(0x005E)
130#define UC_UNDR UC(0x005F)
131
132#define UC_GRV UC(0x0060)
133
134#define UC_a UC(0x0061)
135#define UC_b UC(0x0062)
136#define UC_c UC(0x0063)
137#define UC_d UC(0x0064)
138#define UC_e UC(0x0065)
139#define UC_f UC(0x0066)
140#define UC_g UC(0x0067)
141#define UC_h UC(0x0068)
142#define UC_i UC(0x0069)
143#define UC_j UC(0x006A)
144#define UC_k UC(0x006B)
145#define UC_l UC(0x006C)
146#define UC_m UC(0x006D)
147#define UC_n UC(0x006E)
148#define UC_o UC(0x006F)
149#define UC_p UC(0x0070)
150#define UC_q UC(0x0071)
151#define UC_r UC(0x0072)
152#define UC_s UC(0x0073)
153#define UC_t UC(0x0074)
154#define UC_u UC(0x0075)
155#define UC_v UC(0x0076)
156#define UC_w UC(0x0077)
157#define UC_x UC(0x0078)
158#define UC_y UC(0x0079)
159#define UC_z UC(0x007A)
160
161#define UC_LCBR UC(0x007B)
162#define UC_PIPE UC(0x007C)
163#define UC_RCBR UC(0x007D)
164#define UC_TILD UC(0x007E)
165#define UC_DEL UC(0x007F)
166
167#endif 9#endif
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
new file mode 100644
index 000000000..31bc3b7ab
--- /dev/null
+++ b/quantum/process_keycode/process_unicode_common.c
@@ -0,0 +1,85 @@
1#include "process_unicode_common.h"
2
3uint8_t mods;
4
5void set_unicode_input_mode(uint8_t os_target)
6{
7 input_mode = os_target;
8}
9
10uint8_t get_unicode_input_mode(void) {
11 return input_mode;
12}
13
14__attribute__((weak))
15void unicode_input_start (void) {
16 // save current mods
17 mods = keyboard_report->mods;
18
19 // unregister all mods to start from clean state
20 if (mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT);
21 if (mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT);
22 if (mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL);
23 if (mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL);
24 if (mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT);
25 if (mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT);
26 if (mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI);
27 if (mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI);
28
29 switch(input_mode) {
30 case UC_OSX:
31 register_code(KC_LALT);
32 break;
33 case UC_LNX:
34 register_code(KC_LCTL);
35 register_code(KC_LSFT);
36 register_code(KC_U);
37 unregister_code(KC_U);
38 unregister_code(KC_LSFT);
39 unregister_code(KC_LCTL);
40 break;
41 case UC_WIN:
42 register_code(KC_LALT);
43 register_code(KC_PPLS);
44 unregister_code(KC_PPLS);
45 break;
46 case UC_WINC:
47 register_code(KC_RALT);
48 unregister_code(KC_RALT);
49 register_code(KC_U);
50 unregister_code(KC_U);
51 }
52 wait_ms(UNICODE_TYPE_DELAY);
53}
54
55__attribute__((weak))
56void unicode_input_finish (void) {
57 switch(input_mode) {
58 case UC_OSX:
59 case UC_WIN:
60 unregister_code(KC_LALT);
61 break;
62 case UC_LNX:
63 register_code(KC_SPC);
64 unregister_code(KC_SPC);
65 break;
66 }
67
68 // reregister previously set mods
69 if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT);
70 if (mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT);
71 if (mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL);
72 if (mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL);
73 if (mods & MOD_BIT(KC_LALT)) register_code(KC_LALT);
74 if (mods & MOD_BIT(KC_RALT)) register_code(KC_RALT);
75 if (mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI);
76 if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI);
77}
78
79void register_hex(uint16_t hex) {
80 for(int i = 3; i >= 0; i--) {
81 uint8_t digit = ((hex >> (i*4)) & 0xF);
82 register_code(hex_to_keycode(digit));
83 unregister_code(hex_to_keycode(digit));
84 }
85} \ No newline at end of file
diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h
new file mode 100644
index 000000000..864693cdd
--- /dev/null
+++ b/quantum/process_keycode/process_unicode_common.h
@@ -0,0 +1,132 @@
1#ifndef PROCESS_UNICODE_COMMON_H
2#define PROCESS_UNICODE_COMMON_H
3
4#include "quantum.h"
5
6#ifndef UNICODE_TYPE_DELAY
7#define UNICODE_TYPE_DELAY 10
8#endif
9
10__attribute__ ((unused))
11static uint8_t input_mode;
12
13void set_unicode_input_mode(uint8_t os_target);
14uint8_t get_unicode_input_mode(void);
15void unicode_input_start(void);
16void unicode_input_finish(void);
17void register_hex(uint16_t hex);
18
19#define UC_OSX 0 // Mac OS X
20#define UC_LNX 1 // Linux
21#define UC_WIN 2 // Windows 'HexNumpad'
22#define UC_BSD 3 // BSD (not implemented)
23#define UC_WINC 4 // WinCompose https://github.com/samhocevar/wincompose
24
25#define UC_BSPC UC(0x0008)
26
27#define UC_SPC UC(0x0020)
28
29#define UC_EXLM UC(0x0021)
30#define UC_DQUT UC(0x0022)
31#define UC_HASH UC(0x0023)
32#define UC_DLR UC(0x0024)
33#define UC_PERC UC(0x0025)
34#define UC_AMPR UC(0x0026)
35#define UC_QUOT UC(0x0027)
36#define UC_LPRN UC(0x0028)
37#define UC_RPRN UC(0x0029)
38#define UC_ASTR UC(0x002A)
39#define UC_PLUS UC(0x002B)
40#define UC_COMM UC(0x002C)
41#define UC_DASH UC(0x002D)
42#define UC_DOT UC(0x002E)
43#define UC_SLSH UC(0x002F)
44
45#define UC_0 UC(0x0030)
46#define UC_1 UC(0x0031)
47#define UC_2 UC(0x0032)
48#define UC_3 UC(0x0033)
49#define UC_4 UC(0x0034)
50#define UC_5 UC(0x0035)
51#define UC_6 UC(0x0036)
52#define UC_7 UC(0x0037)
53#define UC_8 UC(0x0038)
54#define UC_9 UC(0x0039)
55
56#define UC_COLN UC(0x003A)
57#define UC_SCLN UC(0x003B)
58#define UC_LT UC(0x003C)
59#define UC_EQL UC(0x003D)
60#define UC_GT UC(0x003E)
61#define UC_QUES UC(0x003F)
62#define UC_AT UC(0x0040)
63
64#define UC_A UC(0x0041)
65#define UC_B UC(0x0042)
66#define UC_C UC(0x0043)
67#define UC_D UC(0x0044)
68#define UC_E UC(0x0045)
69#define UC_F UC(0x0046)
70#define UC_G UC(0x0047)
71#define UC_H UC(0x0048)
72#define UC_I UC(0x0049)
73#define UC_J UC(0x004A)
74#define UC_K UC(0x004B)
75#define UC_L UC(0x004C)
76#define UC_M UC(0x004D)
77#define UC_N UC(0x004E)
78#define UC_O UC(0x004F)
79#define UC_P UC(0x0050)
80#define UC_Q UC(0x0051)
81#define UC_R UC(0x0052)
82#define UC_S UC(0x0053)
83#define UC_T UC(0x0054)
84#define UC_U UC(0x0055)
85#define UC_V UC(0x0056)
86#define UC_W UC(0x0057)
87#define UC_X UC(0x0058)
88#define UC_Y UC(0x0059)
89#define UC_Z UC(0x005A)
90
91#define UC_LBRC UC(0x005B)
92#define UC_BSLS UC(0x005C)
93#define UC_RBRC UC(0x005D)
94#define UC_CIRM UC(0x005E)
95#define UC_UNDR UC(0x005F)
96
97#define UC_GRV UC(0x0060)
98
99#define UC_a UC(0x0061)
100#define UC_b UC(0x0062)
101#define UC_c UC(0x0063)
102#define UC_d UC(0x0064)
103#define UC_e UC(0x0065)
104#define UC_f UC(0x0066)
105#define UC_g UC(0x0067)
106#define UC_h UC(0x0068)
107#define UC_i UC(0x0069)
108#define UC_j UC(0x006A)
109#define UC_k UC(0x006B)
110#define UC_l UC(0x006C)
111#define UC_m UC(0x006D)
112#define UC_n UC(0x006E)
113#define UC_o UC(0x006F)
114#define UC_p UC(0x0070)
115#define UC_q UC(0x0071)
116#define UC_r UC(0x0072)
117#define UC_s UC(0x0073)
118#define UC_t UC(0x0074)
119#define UC_u UC(0x0075)
120#define UC_v UC(0x0076)
121#define UC_w UC(0x0077)
122#define UC_x UC(0x0078)
123#define UC_y UC(0x0079)
124#define UC_z UC(0x007A)
125
126#define UC_LCBR UC(0x007B)
127#define UC_PIPE UC(0x007C)
128#define UC_RCBR UC(0x007D)
129#define UC_TILD UC(0x007E)
130#define UC_DEL UC(0x007F)
131
132#endif \ No newline at end of file
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
new file mode 100644
index 000000000..37f10df86
--- /dev/null
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -0,0 +1,54 @@
1#include "process_unicodemap.h"
2
3__attribute__((weak))
4const uint32_t PROGMEM unicode_map[] = {
5};
6
7void register_hex32(uint32_t hex) {
8 uint8_t onzerostart = 1;
9 for(int i = 7; i >= 0; i--) {
10 if (i <= 3) {
11 onzerostart = 0;
12 }
13 uint8_t digit = ((hex >> (i*4)) & 0xF);
14 if (digit == 0) {
15 if (onzerostart == 0) {
16 register_code(hex_to_keycode(digit));
17 unregister_code(hex_to_keycode(digit));
18 }
19 } else {
20 register_code(hex_to_keycode(digit));
21 unregister_code(hex_to_keycode(digit));
22 onzerostart = 0;
23 }
24 }
25}
26
27__attribute__((weak))
28void unicode_map_input_error() {}
29
30bool process_unicode_map(uint16_t keycode, keyrecord_t *record) {
31 if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) {
32 const uint32_t* map = unicode_map;
33 uint16_t index = keycode - QK_UNICODE_MAP;
34 uint32_t code = pgm_read_dword_far(&map[index]);
35 if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) {
36 // Convert to UTF-16 surrogate pair
37 code -= 0x10000;
38 uint32_t lo = code & 0x3ff;
39 uint32_t hi = (code & 0xffc00) >> 10;
40 unicode_input_start();
41 register_hex32(hi + 0xd800);
42 register_hex32(lo + 0xdc00);
43 unicode_input_finish();
44 } else if ((code > 0x10ffff && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) {
45 // when character is out of range supported by the OS
46 unicode_map_input_error();
47 } else {
48 unicode_input_start();
49 register_hex32(code);
50 unicode_input_finish();
51 }
52 }
53 return true;
54} \ No newline at end of file
diff --git a/quantum/process_keycode/process_unicodemap.h b/quantum/process_keycode/process_unicodemap.h
new file mode 100644
index 000000000..64a7a0109
--- /dev/null
+++ b/quantum/process_keycode/process_unicodemap.h
@@ -0,0 +1,9 @@
1#ifndef PROCESS_UNICODEMAP_H
2#define PROCESS_UNICODEMAP_H
3
4#include "quantum.h"
5#include "process_unicode_common.h"
6
7void unicode_map_input_error(void);
8bool process_unicode_map(uint16_t keycode, keyrecord_t *record);
9#endif \ No newline at end of file
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 2088c10c9..4a6d0355f 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -972,6 +972,19 @@ void send_nibble(uint8_t number) {
972 } 972 }
973} 973}
974 974
975
976__attribute__((weak))
977uint16_t hex_to_keycode(uint8_t hex)
978{
979 if (hex == 0x0) {
980 return KC_0;
981 } else if (hex < 0xA) {
982 return KC_1 + (hex - 0x1);
983 } else {
984 return KC_A + (hex - 0xA);
985 }
986}
987
975void api_send_unicode(uint32_t unicode) { 988void api_send_unicode(uint32_t unicode) {
976#ifdef API_ENABLE 989#ifdef API_ENABLE
977 uint8_t chunk[4]; 990 uint8_t chunk[4];
diff --git a/quantum/quantum.h b/quantum/quantum.h
index 18f072189..580d51202 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -56,6 +56,14 @@ extern uint32_t default_layer_state;
56 #include "process_unicode.h" 56 #include "process_unicode.h"
57#endif 57#endif
58 58
59#ifdef UCIS_ENABLE
60 #include "process_ucis.h"
61#endif
62
63#ifdef UNICODEMAP_ENABLE
64 #include "process_unicodemap.h"
65#endif
66
59#include "process_tap_dance.h" 67#include "process_tap_dance.h"
60 68
61#ifdef PRINTING_ENABLE 69#ifdef PRINTING_ENABLE
@@ -117,7 +125,7 @@ void send_dword(uint32_t number);
117void send_word(uint16_t number); 125void send_word(uint16_t number);
118void send_byte(uint8_t number); 126void send_byte(uint8_t number);
119void send_nibble(uint8_t number); 127void send_nibble(uint8_t number);
120 128uint16_t hex_to_keycode(uint8_t hex);
121 129
122void led_set_user(uint8_t usb_led); 130void led_set_user(uint8_t usb_led);
123void led_set_kb(uint8_t usb_led); 131void led_set_kb(uint8_t usb_led);
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index cc7a5013f..63b626926 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -41,16 +41,21 @@ enum quantum_keycodes {
41#endif 41#endif
42 QK_TAP_DANCE = 0x5700, 42 QK_TAP_DANCE = 0x5700,
43 QK_TAP_DANCE_MAX = 0x57FF, 43 QK_TAP_DANCE_MAX = 0x57FF,
44#ifdef UNICODEMAP_ENABLE 44 QK_LAYER_TAP_TOGGLE = 0x5800,
45 QK_UNICODE_MAP = 0x5800, 45 QK_LAYER_TAP_TOGGLE_MAX = 0x58FF,
46 QK_UNICODE_MAP_MAX = 0x5BFF,
47#endif
48 QK_MOD_TAP = 0x6000, 46 QK_MOD_TAP = 0x6000,
49 QK_MOD_TAP_MAX = 0x7FFF, 47 QK_MOD_TAP_MAX = 0x7FFF,
48#if defined(UNICODEMAP_ENABLE) && defined(UNICODE_ENABLE)
49 #error "Cannot enable both UNICODEMAP && UNICODE"
50#endif
50#ifdef UNICODE_ENABLE 51#ifdef UNICODE_ENABLE
51 QK_UNICODE = 0x8000, 52 QK_UNICODE = 0x8000,
52 QK_UNICODE_MAX = 0xFFFF, 53 QK_UNICODE_MAX = 0xFFFF,
53#endif 54#endif
55#ifdef UNICODEMAP_ENABLE
56 QK_UNICODE_MAP = 0x8000,
57 QK_UNICODE_MAP_MAX = 0x83FF,
58#endif
54 59
55 // Loose keycodes - to be used directly 60 // Loose keycodes - to be used directly
56 61
@@ -304,6 +309,9 @@ enum quantum_keycodes {
304// One-shot mod 309// One-shot mod
305#define OSM(mod) (mod | QK_ONE_SHOT_MOD) 310#define OSM(mod) (mod | QK_ONE_SHOT_MOD)
306 311
312// Layer tap-toggle
313#define TT(layer) (layer | QK_LAYER_TAP_TOGGLE)
314
307// M-od, T-ap - 256 keycode max 315// M-od, T-ap - 256 keycode max
308#define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8)) 316#define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8))
309 317
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index a3c757964..58d919a04 100644
--- a/tmk_core/common/action_layer.c
+++ b/tmk_core/common/action_layer.c
@@ -16,8 +16,14 @@
16 */ 16 */
17uint32_t default_layer_state = 0; 17uint32_t default_layer_state = 0;
18 18
19__attribute__((weak))
20uint32_t default_layer_state_set_kb(uint32_t state) {
21 return state;
22}
23
19static void default_layer_state_set(uint32_t state) 24static void default_layer_state_set(uint32_t state)
20{ 25{
26 state = default_layer_state_set_kb(state);
21 debug("default_layer_state: "); 27 debug("default_layer_state: ");
22 default_layer_debug(); debug(" to "); 28 default_layer_debug(); debug(" to ");
23 default_layer_state = state; 29 default_layer_state = state;
@@ -57,8 +63,14 @@ void default_layer_xor(uint32_t state)
57 */ 63 */
58uint32_t layer_state = 0; 64uint32_t layer_state = 0;
59 65
66__attribute__((weak))
67uint32_t layer_state_set_kb(uint32_t state) {
68 return state;
69}
70
60static void layer_state_set(uint32_t state) 71static void layer_state_set(uint32_t state)
61{ 72{
73 state = layer_state_set_kb(state);
62 dprint("layer_state: "); 74 dprint("layer_state: ");
63 layer_debug(); dprint(" to "); 75 layer_debug(); dprint(" to ");
64 layer_state = state; 76 layer_state = state;
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h
index 025cf5420..d89ed6e5c 100644
--- a/tmk_core/common/action_layer.h
+++ b/tmk_core/common/action_layer.h
@@ -29,6 +29,9 @@ extern uint32_t default_layer_state;
29void default_layer_debug(void); 29void default_layer_debug(void);
30void default_layer_set(uint32_t state); 30void default_layer_set(uint32_t state);
31 31
32__attribute__((weak))
33uint32_t default_layer_state_set_kb(uint32_t state);
34
32#ifndef NO_ACTION_LAYER 35#ifndef NO_ACTION_LAYER
33/* bitwise operation */ 36/* bitwise operation */
34void default_layer_or(uint32_t state); 37void default_layer_or(uint32_t state);
@@ -69,6 +72,8 @@ void layer_xor(uint32_t state);
69#define layer_xor(state) 72#define layer_xor(state)
70#define layer_debug() 73#define layer_debug()
71 74
75__attribute__((weak))
76uint32_t layer_state_set_kb(uint32_t state);
72#endif 77#endif
73 78
74/* pressed actions cache */ 79/* pressed actions cache */
diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh
index de2481ce5..58334cb1f 100644
--- a/util/travis_compiled_push.sh
+++ b/util/travis_compiled_push.sh
@@ -7,7 +7,7 @@ rev=$(git rev-parse --short HEAD)
7git config --global user.name "Travis CI" 7git config --global user.name "Travis CI"
8git config --global user.email "jack.humb+travis.ci@gmail.com" 8git config --global user.email "jack.humb+travis.ci@gmail.com"
9 9
10if [[ "$TRAVIS_BRANCH" == "master" ]] ; then 10if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then
11 11
12increment_version () 12increment_version ()
13{ 13{