1 #include QMK_KEYBOARD_H
4 * This keymap simulates the key limitations of an Iris on an ErgoDox. See the
5 * matching iris layout (/keyboards/iris/keymaps/nstickney) for further
10 #define BASE 0 // Base layer
11 #define SYMB 1 // Symbols
12 #define SYSH 2 // Symbols, shifted
13 #define NUMP 4 // Numpad
14 #define FCTN 8 // Function
17 void dance_lock (qk_tap_dance_state_t *state, void *user_data) {
18 switch (state->count){
19 case 1: // Press once for LGUI
22 case 2: // Press twice for NUMLOCK
25 case 3: // Press thrice for CAPSLOCK
28 case 4: // Press four times for SCROLLOCK
36 void dance_layer (qk_tap_dance_state_t *state, void *user_data) {
37 switch (state -> count) {
38 case 1: // Press once for MENU
41 case 2: // Press twice for NUMPAD
44 case 3: // Press thrice for SYMBOLS
47 case 4: // Press four times for SYMBOLS, SHIFTED
55 enum tap_dances {LOCKS = 0, LAYERS = 1};
56 qk_tap_dance_action_t tap_dance_actions[] = {
57 [LOCKS] = ACTION_TAP_DANCE_FN(dance_lock),
58 [LAYERS] = ACTION_TAP_DANCE_FN(dance_layer)
61 // Make layering more clear
62 enum custom_keycodes {
65 CC_ESC = LCTL_T(KC_ESC),
66 CC_QUOT = RCTL_T(KC_QUOT),
67 AC_SLSH = LALT_T(KC_SLSH),
68 AC_EQL = RALT_T(KC_EQL),
69 FC_BSLS = LT(FCTN, KC_BSLS),
70 FC_MINS = LT(FCTN, KC_MINS),
73 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
74 [BASE] = LAYOUT_ergodox(
76 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, XXX,
77 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXX,
78 CC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G,
79 KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, XXX,
80 XXX, XXX, XXX, XXX, AC_SLSH,
85 XXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
86 XXX, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
87 KC_H, KC_J, KC_K, KC_L, KC_SCLN, CC_QUOT,
88 XXX, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC,
89 AC_EQL, XXX, XXX, XXX, XXX,
95 [SYMB] = LAYOUT_ergodox(
97 UC(0x00EF), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), __________,
98 __________, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), __________,
99 __________, UC(0x00E1), UC(0x00DF), UC(0x00F0), UC(0x00EC), UC(0x00ED),
100 __________, UC(0x00E6), UC(0x00E8), UC(0x00A9), UC(0x00EA), UC(0x00EB), __________,
101 __________, __________, __________, __________, UC(0x00BF),
102 __________, __________,
104 UC(0x00AC), __________, __________,
106 __________, UC(0x00BC), UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), __________,
107 __________, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), __________,
108 UC(0x00EE), UC(0x00E0), UC(0x00E2), UC(0x00F8), UC(0x00B6), UC(0x00B4),
109 __________, UC(0x00F1), UC(0x00FD), UC(0x00E7), UC(0x00F4), UC(0x00BF), __________,
110 UC(0x00D7), __________, __________, __________, __________,
111 __________, __________,
113 __________, __________, UC(0x00B1)
116 [SYSH] = LAYOUT_ergodox(
118 UC(0x00CF), UC(0x00B9), UC(0x2200), UC(0x2201), UC(0x00A3), UC(0x00A5), __________,
119 __________, UC(0x00C4), UC(0x00C5), UC(0x00C9), UC(0x2122), UC(0x00DE), __________,
120 __________, UC(0x00C1), UC(0x00A7), UC(0x00D0), UC(0x00CC), UC(0x00CD),
121 __________, UC(0x00C6), UC(0x00C8), UC(0x00A2), UC(0x00CA), UC(0x00CB), __________,
122 __________, __________, __________, __________, UC(0x203D),
123 __________, __________,
125 UC(0x00A6), __________, __________,
127 __________, UC(0x00B5), UC(0x00AB), UC(0x00BB), UC(0x201C), UC(0x201D), __________,
128 __________, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), __________,
129 UC(0x00CE), UC(0x00C1), UC(0x00C2), UC(0x00D8), UC(0x00B0), UC(0x00A8),
130 __________, UC(0x00D1), UC(0x00DD), UC(0x00C7), UC(0x00D4), UC(0x203D), __________,
131 UC(0x00F7), __________, __________, __________, __________,
132 __________, __________,
134 __________, __________, UC(0x00AA)
137 [NUMP] = LAYOUT_ergodox(
139 __________, __________, KC_P7, KC_P8, KC_P9, KC_PSLS, __________,
140 __________, __________, KC_P4, KC_P5, KC_P6, KC_PAST, __________,
141 __________, __________, KC_P1, KC_P2, KC_P3, KC_PMNS,
142 __________, __________, KC_P0, KC_PCMM, KC_PDOT, KC_PPLS, __________,
143 __________, __________, __________, __________, __________,
144 __________, __________,
146 __________, __________, __________,
148 __________, __________, KC_P7, KC_P8, KC_P9, KC_PSLS, __________,
149 __________, __________, KC_P4, KC_P5, KC_P6, KC_PAST, __________,
150 __________, KC_P1, KC_P2, KC_P3, KC_PMNS, __________,
151 __________, __________, KC_P0, KC_PCMM, KC_PDOT, KC_PPLS, __________,
152 __________, __________, __________, __________, __________,
153 __________, __________,
155 __________, KC_PENT, __________
158 [FCTN] = LAYOUT_ergodox(
160 KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, __________,
161 KC_PSCR, RGB_TOG, KC_HOME, KC_UP, KC_END, KC_PGUP, __________,
162 KC_PAUS, __________, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN,
163 __________, KC_MPRV, KC_MRWD, KC_MPLY, KC_MFFD, KC_MNXT, __________,
164 __________, __________, __________, __________, __________,
167 __________, __________, __________,
169 __________, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_SYSREQ,
170 __________, UC(0x2014), KC_LBRC, KC_RBRC, S(KC_LBRC), S(KC_RBRC), KC_INS,
171 KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_BRIU, KC_CLR,
172 __________, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_BRID, __________,
173 __________, __________, __________, __________, __________,
176 __________, __________, __________
180 void eeconfig_init_user(void) {
181 set_unicode_input_mode(UC_LNX); // Linux
182 //set_unicode_input_mode(UC_OSX); // Mac OSX
183 //set_unicode_input_mode(UC_WIN); // Windows (with registry key, see wiki)
184 //set_unicode_input_mode(UC_WINC); // Windows (with WinCompose, see wiki)
187 // Runs just one time when the keyboard initializes.
188 void matrix_init_user(void) {
189 ergodox_board_led_off();
192 // Runs constantly in the background, in a loop.
193 void matrix_scan_user(void) {
195 if (IS_LAYER_ON(SYMB) || IS_LAYER_ON(SYSH)) {
196 ergodox_right_led_1_on();
198 ergodox_right_led_1_off();
201 if (IS_LAYER_ON(NUMP)) {
202 ergodox_right_led_2_on();
204 ergodox_right_led_2_off();
207 if (IS_LAYER_ON(FCTN)) {
208 ergodox_right_led_3_on();
210 ergodox_right_led_3_off();