diff options
Diffstat (limited to 'keyboards/comet46/keymaps')
-rw-r--r-- | keyboards/comet46/keymaps/default-rgbled/keymap.c | 223 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/default-rgbled/readme.md | 3 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/default/config.h | 29 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/default/keymap.c | 253 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/default/readme.md | 3 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/default/rules.mk | 5 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/action_pseudo_lut.c | 143 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/action_pseudo_lut.h | 15 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/config.h | 29 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/keymap.c | 288 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/keymap_jis2us.h | 32 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/readme.md | 6 | ||||
-rw-r--r-- | keyboards/comet46/keymaps/satt/rules.mk | 8 |
13 files changed, 1037 insertions, 0 deletions
diff --git a/keyboards/comet46/keymaps/default-rgbled/keymap.c b/keyboards/comet46/keymaps/default-rgbled/keymap.c new file mode 100644 index 000000000..d1e5b663d --- /dev/null +++ b/keyboards/comet46/keymaps/default-rgbled/keymap.c | |||
@@ -0,0 +1,223 @@ | |||
1 | // this is the style you want to emulate. | ||
2 | // This is the canonical layout file for the Quantum project. If you want to add another keyboard, | ||
3 | |||
4 | #include QMK_KEYBOARD_H | ||
5 | |||
6 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
7 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
8 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
9 | // entirely and just use numbers. | ||
10 | enum comet46_layers | ||
11 | { | ||
12 | _QWERTY, | ||
13 | _COLEMAK, | ||
14 | _DVORAK, | ||
15 | _LOWER, | ||
16 | _RAISE, | ||
17 | _ADJUST, | ||
18 | }; | ||
19 | |||
20 | enum custom_keycodes { | ||
21 | QWERTY = SAFE_RANGE, | ||
22 | COLEMAK, | ||
23 | DVORAK, | ||
24 | LOWER, | ||
25 | RAISE, | ||
26 | }; | ||
27 | |||
28 | #define LOWER MO(_LOWER) | ||
29 | #define RAISE MO(_RAISE) | ||
30 | |||
31 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
32 | |||
33 | /* Qwerty | ||
34 | * ,-----------------------------------------+ +-----------------------------------------. | ||
35 | * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | | ||
36 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
37 | * | Ctl | A | S | D | F | G | Esc | | Del | H | J | K | L | ; | " | | ||
38 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
39 | * | Shift| Z | X | C | V | B | { | | } | N | M | , | . | / | Shift| | ||
40 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
41 | * | GUI | Lower| Space| | Enter| Raise| Alt | | ||
42 | * +--------------------/ \--------------------+ | ||
43 | */ | ||
44 | [_QWERTY] = LAYOUT( | ||
45 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
46 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_ESC, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
47 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
48 | KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT | ||
49 | ), | ||
50 | |||
51 | /* Colemak | ||
52 | * ,-----------------------------------------+ +-----------------------------------------. | ||
53 | * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | | ||
54 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
55 | * | Ctl | A | R | S | T | D | Esc | | Del | H | N | E | I | O | " | | ||
56 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
57 | * | Shift| Z | X | C | V | B | { | | } | K | M | , | . | / | Shift| | ||
58 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
59 | * | GUI | Lower| Space| | Enter| Raise| Alt | | ||
60 | * +--------------------/ \--------------------+ | ||
61 | */ | ||
62 | [_COLEMAK] = LAYOUT( | ||
63 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, | ||
64 | KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_DEL, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, | ||
65 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
66 | KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT | ||
67 | ), | ||
68 | |||
69 | /* Dvorak | ||
70 | * ,-----------------------------------------+ +-----------------------------------------. | ||
71 | * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | | ||
72 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
73 | * | Ctl | A | O | E | U | I | Esc | | Del | D | H | T | N | S | / | | ||
74 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
75 | * | Shift| ; | Q | J | K | X | { | | } | B | M | W | V | Z | Shift| | ||
76 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
77 | * | GUI | Lower| Space| | Enter| Raise| Alt | | ||
78 | * +--------------------/ \--------------------+ | ||
79 | */ | ||
80 | [_DVORAK] = LAYOUT( | ||
81 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, | ||
82 | KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_DEL, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, | ||
83 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, | ||
84 | KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT | ||
85 | ), | ||
86 | |||
87 | /* Lower | ||
88 | * ,-----------------------------------------+ +-----------------------------------------. | ||
89 | * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | ||
90 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
91 | * | | | | | | | | | ` | \ | - | = | [ | ] | | | ||
92 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
93 | * | | | | | | | | | ~ | | | _ | + | { | } | | | ||
94 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
95 | * | | | | | | | | | ||
96 | * +--------------------/ \--------------------+ | ||
97 | */ | ||
98 | [_LOWER] = LAYOUT( | ||
99 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
100 | _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, | ||
101 | _______, _______, _______, _______, _______, _______, _______, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, | ||
102 | _______, _______, _______, _______, _______, _______ | ||
103 | ), | ||
104 | |||
105 | /* Raise | ||
106 | * ,-----------------------------------------+ +-----------------------------------------. | ||
107 | * | | 1 | 2 | 3 | 4 | 5 | | | | | | | | | ||
108 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
109 | * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | End | | | ||
110 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
111 | * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | PgDn | PgUp | | | | | ||
112 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
113 | * | | | | | | | | | ||
114 | * +--------------------/ \--------------------+ | ||
115 | */ | ||
116 | [_RAISE] = LAYOUT( | ||
117 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
118 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, _______, | ||
119 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______, | ||
120 | _______, _______, _______, _______, _______, _______ | ||
121 | ), | ||
122 | |||
123 | /* Adjust | ||
124 | * ,-----------------------------------------+ +-----------------------------------------. | ||
125 | * | | | | | | | | | | | | | | | ||
126 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
127 | * | | | | | | |Qwerty| |Colemk| | | | | | | | ||
128 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
129 | * | | | | | | |Reset | |Dvorak| | | | | | | | ||
130 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
131 | * | | | | | | | | | ||
132 | * +--------------------/ \--------------------+ | ||
133 | */ | ||
134 | [_ADJUST] = LAYOUT( | ||
135 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
136 | _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, | ||
137 | _______, _______, _______, _______, _______, _______, RESET, DVORAK, _______, _______, _______, _______, _______, _______, | ||
138 | _______, _______, _______, _______, _______, _______ | ||
139 | ) | ||
140 | }; | ||
141 | |||
142 | |||
143 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
144 | return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | ||
145 | } | ||
146 | |||
147 | // settings for LED on receiver | ||
148 | void led_init(void) { | ||
149 | DDRD |= (1<<1); | ||
150 | PORTD |= (1<<1); | ||
151 | DDRF |= (1<<4) | (1<<5); | ||
152 | PORTF |= (1<<4) | (1<<5); | ||
153 | } | ||
154 | |||
155 | #define red_led_off PORTF |= (1<<5) | ||
156 | #define red_led_on PORTF &= ~(1<<5) | ||
157 | #define blu_led_off PORTF |= (1<<4) | ||
158 | #define blu_led_on PORTF &= ~(1<<4) | ||
159 | #define grn_led_off PORTD |= (1<<1) | ||
160 | #define grn_led_on PORTD &= ~(1<<1) | ||
161 | |||
162 | #define set_led_off red_led_off; grn_led_off; blu_led_off | ||
163 | #define set_led_red red_led_on; grn_led_off; blu_led_off | ||
164 | #define set_led_blue red_led_off; grn_led_off; blu_led_on | ||
165 | #define set_led_green red_led_off; grn_led_on; blu_led_off | ||
166 | #define set_led_yellow red_led_on; grn_led_on; blu_led_off | ||
167 | #define set_led_magenta red_led_on; grn_led_off; blu_led_on | ||
168 | #define set_led_cyan red_led_off; grn_led_on; blu_led_on | ||
169 | #define set_led_white red_led_on; grn_led_on; blu_led_on | ||
170 | |||
171 | void matrix_init_user(void) { | ||
172 | led_init(); | ||
173 | } | ||
174 | |||
175 | void matrix_scan_user(void) { | ||
176 | uint8_t layer = biton32(layer_state); | ||
177 | uint8_t default_layer = biton32(eeconfig_read_default_layer()); | ||
178 | switch (layer) { | ||
179 | case _LOWER: | ||
180 | set_led_red; | ||
181 | break; | ||
182 | case _RAISE: | ||
183 | set_led_blue; | ||
184 | break; | ||
185 | case _ADJUST: | ||
186 | set_led_magenta; | ||
187 | break; | ||
188 | default: | ||
189 | switch (default_layer) { | ||
190 | case _COLEMAK: | ||
191 | set_led_white; | ||
192 | break; | ||
193 | case _DVORAK: | ||
194 | set_led_yellow; | ||
195 | break; | ||
196 | default: | ||
197 | set_led_green; | ||
198 | break; | ||
199 | } | ||
200 | break; | ||
201 | } | ||
202 | }; | ||
203 | |||
204 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
205 | switch (keycode) { | ||
206 | case QWERTY: | ||
207 | if (record->event.pressed) { | ||
208 | set_single_persistent_default_layer(_QWERTY); | ||
209 | } | ||
210 | break; | ||
211 | case COLEMAK: | ||
212 | if (record->event.pressed) { | ||
213 | set_single_persistent_default_layer(_COLEMAK); | ||
214 | } | ||
215 | break; | ||
216 | case DVORAK: | ||
217 | if (record->event.pressed) { | ||
218 | set_single_persistent_default_layer(_DVORAK); | ||
219 | } | ||
220 | break; | ||
221 | } | ||
222 | return true; | ||
223 | } | ||
diff --git a/keyboards/comet46/keymaps/default-rgbled/readme.md b/keyboards/comet46/keymaps/default-rgbled/readme.md new file mode 100644 index 000000000..40cc74433 --- /dev/null +++ b/keyboards/comet46/keymaps/default-rgbled/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | ## default-led | ||
2 | |||
3 | A keymap that is compatible with mitosis-type receivers, which use RGB LED for layer indication. | ||
diff --git a/keyboards/comet46/keymaps/default/config.h b/keyboards/comet46/keymaps/default/config.h new file mode 100644 index 000000000..ee02a94b7 --- /dev/null +++ b/keyboards/comet46/keymaps/default/config.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | This is the c configuration file for the keymap | ||
3 | |||
4 | Copyright 2012 Jun Wako <[email protected]> | ||
5 | Copyright 2015 Jack Humbert | ||
6 | |||
7 | This program is free software: you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation, either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #pragma once | ||
22 | |||
23 | // place overrides here | ||
24 | |||
25 | |||
26 | /* Use I2C or Serial */ | ||
27 | |||
28 | #define USE_I2C | ||
29 | #define SSD1306OLED | ||
diff --git a/keyboards/comet46/keymaps/default/keymap.c b/keyboards/comet46/keymaps/default/keymap.c new file mode 100644 index 000000000..7a8c29dcb --- /dev/null +++ b/keyboards/comet46/keymaps/default/keymap.c | |||
@@ -0,0 +1,253 @@ | |||
1 | // this is the style you want to emulate. | ||
2 | // This is the canonical layout file for the Quantum project. If you want to add another keyboard, | ||
3 | |||
4 | #include QMK_KEYBOARD_H | ||
5 | #ifdef SSD1306OLED | ||
6 | #include "ssd1306.h" | ||
7 | #endif | ||
8 | |||
9 | |||
10 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
11 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
12 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
13 | // entirely and just use numbers. | ||
14 | enum comet46_layers | ||
15 | { | ||
16 | _QWERTY, | ||
17 | _COLEMAK, | ||
18 | _DVORAK, | ||
19 | _LOWER, | ||
20 | _RAISE, | ||
21 | _ADJUST, | ||
22 | }; | ||
23 | |||
24 | enum custom_keycodes { | ||
25 | QWERTY = SAFE_RANGE, | ||
26 | COLEMAK, | ||
27 | DVORAK, | ||
28 | LOWER, | ||
29 | RAISE, | ||
30 | }; | ||
31 | |||
32 | #define LOWER MO(_LOWER) | ||
33 | #define RAISE MO(_RAISE) | ||
34 | |||
35 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
36 | |||
37 | /* Qwerty | ||
38 | * ,-----------------------------------------+ +-----------------------------------------. | ||
39 | * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | | ||
40 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
41 | * | Ctl | A | S | D | F | G | Esc | | Del | H | J | K | L | ; | " | | ||
42 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
43 | * | Shift| Z | X | C | V | B | { | | } | N | M | , | . | / | Shift| | ||
44 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
45 | * | GUI | Lower| Space| | Enter| Raise| Alt | | ||
46 | * +--------------------/ \--------------------+ | ||
47 | */ | ||
48 | [_QWERTY] = LAYOUT( | ||
49 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, | ||
50 | KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_ESC, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, | ||
51 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
52 | KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT | ||
53 | ), | ||
54 | |||
55 | /* Colemak | ||
56 | * ,-----------------------------------------+ +-----------------------------------------. | ||
57 | * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | | ||
58 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
59 | * | Ctl | A | R | S | T | D | Esc | | Del | H | N | E | I | O | " | | ||
60 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
61 | * | Shift| Z | X | C | V | B | { | | } | K | M | , | . | / | Shift| | ||
62 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
63 | * | GUI | Lower| Space| | Enter| Raise| Alt | | ||
64 | * +--------------------/ \--------------------+ | ||
65 | */ | ||
66 | [_COLEMAK] = LAYOUT( | ||
67 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, | ||
68 | KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_DEL, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, | ||
69 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, | ||
70 | KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT | ||
71 | ), | ||
72 | |||
73 | /* Dvorak | ||
74 | * ,-----------------------------------------+ +-----------------------------------------. | ||
75 | * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | | ||
76 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
77 | * | Ctl | A | O | E | U | I | Esc | | Del | D | H | T | N | S | / | | ||
78 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
79 | * | Shift| ; | Q | J | K | X | { | | } | B | M | W | V | Z | Shift| | ||
80 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
81 | * | GUI | Lower| Space| | Enter| Raise| Alt | | ||
82 | * +--------------------/ \--------------------+ | ||
83 | */ | ||
84 | [_DVORAK] = LAYOUT( | ||
85 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, | ||
86 | KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_DEL, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, | ||
87 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, | ||
88 | KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT | ||
89 | ), | ||
90 | |||
91 | /* Lower | ||
92 | * ,-----------------------------------------+ +-----------------------------------------. | ||
93 | * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | | ||
94 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
95 | * | | | | | | | | | ` | \ | - | = | [ | ] | | | ||
96 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
97 | * | | | | | | | | | ~ | | | _ | + | { | } | | | ||
98 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
99 | * | | | | | | | | | ||
100 | * +--------------------/ \--------------------+ | ||
101 | */ | ||
102 | [_LOWER] = LAYOUT( | ||
103 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, | ||
104 | _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, | ||
105 | _______, _______, _______, _______, _______, _______, _______, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, | ||
106 | _______, _______, _______, _______, _______, _______ | ||
107 | ), | ||
108 | |||
109 | /* Raise | ||
110 | * ,-----------------------------------------+ +-----------------------------------------. | ||
111 | * | | 1 | 2 | 3 | 4 | 5 | | | | | | | | | ||
112 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
113 | * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | End | | | ||
114 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
115 | * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | PgDn | PgUp | | | | | ||
116 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
117 | * | | | | | | | | | ||
118 | * +--------------------/ \--------------------+ | ||
119 | */ | ||
120 | [_RAISE] = LAYOUT( | ||
121 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, | ||
122 | _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, _______, | ||
123 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______, | ||
124 | _______, _______, _______, _______, _______, _______ | ||
125 | ), | ||
126 | |||
127 | /* Adjust | ||
128 | * ,-----------------------------------------+ +-----------------------------------------. | ||
129 | * | | | | | | | | | | | | | | | ||
130 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
131 | * | | | | | | |Qwerty| |Colemk| | | | | | | | ||
132 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| | ||
133 | * | | | | | | |Reset | |Dvorak| | | | | | | | ||
134 | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| | ||
135 | * | | | | | | | | | ||
136 | * +--------------------/ \--------------------+ | ||
137 | */ | ||
138 | [_ADJUST] = LAYOUT( | ||
139 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
140 | _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, | ||
141 | _______, _______, _______, _______, _______, _______, RESET, DVORAK, _______, _______, _______, _______, _______, _______, | ||
142 | _______, _______, _______, _______, _______, _______ | ||
143 | ) | ||
144 | }; | ||
145 | |||
146 | |||
147 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
148 | return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | ||
149 | } | ||
150 | |||
151 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
152 | #ifdef SSD1306OLED | ||
153 | |||
154 | // You need to add source files to SRC in rules.mk when using OLED display functions | ||
155 | void set_keylog(uint16_t keycode); | ||
156 | const char *read_keylog(void); | ||
157 | const char *read_modifier_state(void); | ||
158 | const char *read_host_led_state(void); | ||
159 | |||
160 | void matrix_init_user(void) { | ||
161 | iota_gfx_init(false); // turns on the display | ||
162 | } | ||
163 | |||
164 | void matrix_scan_user(void) { | ||
165 | iota_gfx_task(); // this is what updates the display continuously | ||
166 | } | ||
167 | |||
168 | void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { | ||
169 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
170 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
171 | dest->dirty = true; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | void render_status(struct CharacterMatrix *matrix) { | ||
176 | // Layer state | ||
177 | char layer_str[22]; | ||
178 | matrix_write(matrix, "Layer: "); | ||
179 | uint8_t layer = biton32(layer_state); | ||
180 | uint8_t default_layer = biton32(eeconfig_read_default_layer()); | ||
181 | switch (layer) { | ||
182 | case _QWERTY: | ||
183 | switch (default_layer) { | ||
184 | case _QWERTY: | ||
185 | snprintf(layer_str, sizeof(layer_str), "Qwerty"); | ||
186 | break; | ||
187 | case _COLEMAK: | ||
188 | snprintf(layer_str, sizeof(layer_str), "Colemak"); | ||
189 | break; | ||
190 | case _DVORAK: | ||
191 | snprintf(layer_str, sizeof(layer_str), "Dvorak"); | ||
192 | break; | ||
193 | default: | ||
194 | snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer); | ||
195 | break; | ||
196 | } | ||
197 | break; | ||
198 | case _RAISE: | ||
199 | snprintf(layer_str, sizeof(layer_str), "Raise"); | ||
200 | break; | ||
201 | case _LOWER: | ||
202 | snprintf(layer_str, sizeof(layer_str), "Lower"); | ||
203 | break; | ||
204 | case _ADJUST: | ||
205 | snprintf(layer_str, sizeof(layer_str), "Adjust"); | ||
206 | break; | ||
207 | default: | ||
208 | snprintf(layer_str, sizeof(layer_str), "Undef-%d", layer); | ||
209 | } | ||
210 | matrix_write_ln(matrix, layer_str); | ||
211 | // Last entered keycode | ||
212 | matrix_write_ln(matrix, read_keylog()); | ||
213 | // Modifier state | ||
214 | matrix_write_ln(matrix, read_modifier_state()); | ||
215 | // Host Keyboard LED Status | ||
216 | matrix_write(matrix, read_host_led_state()); | ||
217 | } | ||
218 | |||
219 | |||
220 | void iota_gfx_task_user(void) { | ||
221 | struct CharacterMatrix matrix; | ||
222 | matrix_clear(&matrix); | ||
223 | render_status(&matrix); | ||
224 | matrix_update(&display, &matrix); | ||
225 | } | ||
226 | |||
227 | #endif//SSD1306OLED | ||
228 | |||
229 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
230 | #ifdef SSD1306OLED | ||
231 | if (record->event.pressed) { | ||
232 | set_keylog(keycode); | ||
233 | } | ||
234 | #endif | ||
235 | switch (keycode) { | ||
236 | case QWERTY: | ||
237 | if (record->event.pressed) { | ||
238 | set_single_persistent_default_layer(_QWERTY); | ||
239 | } | ||
240 | break; | ||
241 | case COLEMAK: | ||
242 | if (record->event.pressed) { | ||
243 | set_single_persistent_default_layer(_COLEMAK); | ||
244 | } | ||
245 | break; | ||
246 | case DVORAK: | ||
247 | if (record->event.pressed) { | ||
248 | set_single_persistent_default_layer(_DVORAK); | ||
249 | } | ||
250 | break; | ||
251 | } | ||
252 | return true; | ||
253 | } | ||
diff --git a/keyboards/comet46/keymaps/default/readme.md b/keyboards/comet46/keymaps/default/readme.md new file mode 100644 index 000000000..b0085d2a6 --- /dev/null +++ b/keyboards/comet46/keymaps/default/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | ## default-oled-display | ||
2 | |||
3 | A keymap that is compatible with receivers with an OLED display. | ||
diff --git a/keyboards/comet46/keymaps/default/rules.mk b/keyboards/comet46/keymaps/default/rules.mk new file mode 100644 index 000000000..3fa01f96a --- /dev/null +++ b/keyboards/comet46/keymaps/default/rules.mk | |||
@@ -0,0 +1,5 @@ | |||
1 | # If you want to change display settings of the OLED, you need to change the following lines | ||
2 | SRC += ./lib/glcdfont.c \ | ||
3 | ./lib/keylogger.c \ | ||
4 | ./lib/modifier_state_reader.c \ | ||
5 | ./lib/host_led_state_reader.c | ||
diff --git a/keyboards/comet46/keymaps/satt/action_pseudo_lut.c b/keyboards/comet46/keymaps/satt/action_pseudo_lut.c new file mode 100644 index 000000000..4a7cb3a3a --- /dev/null +++ b/keyboards/comet46/keymaps/satt/action_pseudo_lut.c | |||
@@ -0,0 +1,143 @@ | |||
1 | #include "quantum.h" | ||
2 | #include "command.h" | ||
3 | #include "action_pseudo_lut.h" | ||
4 | |||
5 | static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; | ||
6 | |||
7 | /* | ||
8 | * Pseudo layout action. | ||
9 | * This action converts a keycode in order to output the character according to the keymap you specified | ||
10 | * still your keyboard layout recognized wrongly on your OS. | ||
11 | * Memo: Using other layer keymap to get keycode | ||
12 | */ | ||
13 | void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) { | ||
14 | uint8_t prev_shift; | ||
15 | uint16_t keycode; | ||
16 | uint16_t pseudo_keycode; | ||
17 | |||
18 | /* get keycode from keymap you specified */ | ||
19 | keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); | ||
20 | |||
21 | prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); | ||
22 | |||
23 | if (record->event.pressed) { | ||
24 | /* when magic commands entered, keycode does not converted */ | ||
25 | if (IS_COMMAND()) { | ||
26 | if (prev_shift) { | ||
27 | add_shift_bit(keycode); | ||
28 | } | ||
29 | register_code(keycode); | ||
30 | return; | ||
31 | } | ||
32 | |||
33 | if (prev_shift) { | ||
34 | pseudo_keycode = convert_keycode(keymap, keycode, true); | ||
35 | dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); | ||
36 | add_shift_bit(keycode); | ||
37 | |||
38 | if (IS_LSFT(pseudo_keycode)) { | ||
39 | register_code(QK_LSFT ^ pseudo_keycode); | ||
40 | } else { | ||
41 | /* delete shift mod temporarily */ | ||
42 | del_mods(prev_shift); | ||
43 | send_keyboard_report(); | ||
44 | register_code(pseudo_keycode); | ||
45 | add_mods(prev_shift); | ||
46 | send_keyboard_report(); | ||
47 | } | ||
48 | } else { | ||
49 | pseudo_keycode = convert_keycode(keymap, keycode, false); | ||
50 | dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); | ||
51 | |||
52 | if (IS_LSFT(pseudo_keycode)) { | ||
53 | add_weak_mods(MOD_BIT(KC_LSFT)); | ||
54 | send_keyboard_report(); | ||
55 | register_code(QK_LSFT ^ pseudo_keycode); | ||
56 | /* on Windows, prevent key repeat to avoid unintended output */ | ||
57 | unregister_code(QK_LSFT ^ pseudo_keycode); | ||
58 | del_weak_mods(MOD_BIT(KC_LSFT)); | ||
59 | send_keyboard_report(); | ||
60 | } else { | ||
61 | register_code(pseudo_keycode); | ||
62 | } | ||
63 | } | ||
64 | } else { | ||
65 | if (get_shift_bit(keycode)) { | ||
66 | del_shift_bit(keycode); | ||
67 | pseudo_keycode = convert_keycode(keymap, keycode, true); | ||
68 | } else { | ||
69 | pseudo_keycode = convert_keycode(keymap, keycode, false); | ||
70 | } | ||
71 | dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); | ||
72 | |||
73 | if (IS_LSFT(pseudo_keycode)) { | ||
74 | unregister_code(QK_LSFT ^ pseudo_keycode); | ||
75 | } else { | ||
76 | unregister_code(pseudo_keycode); | ||
77 | } | ||
78 | } | ||
79 | } | ||
80 | |||
81 | uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded) | ||
82 | { | ||
83 | uint16_t pseudo_keycode; | ||
84 | |||
85 | switch (keycode) { | ||
86 | case KC_A ... KC_CAPSLOCK: | ||
87 | #if defined(__AVR__) | ||
88 | if (shift_modded) { | ||
89 | pseudo_keycode = pgm_read_word(&keymap[keycode][1]); | ||
90 | } else { | ||
91 | pseudo_keycode = pgm_read_word(&keymap[keycode][0]); | ||
92 | } | ||
93 | #else | ||
94 | if (shift_modded) { | ||
95 | pseudo_keycode = keymap[keycode][1]; | ||
96 | } else { | ||
97 | pseudo_keycode = keymap[keycode][0]; | ||
98 | } | ||
99 | #endif | ||
100 | /* if undefined, use got keycode as it is */ | ||
101 | if (pseudo_keycode == 0x00) { | ||
102 | if (shift_modded) { | ||
103 | pseudo_keycode = S(keycode); | ||
104 | } else { | ||
105 | pseudo_keycode = keycode; | ||
106 | } | ||
107 | } | ||
108 | break; | ||
109 | default: | ||
110 | if (shift_modded) { | ||
111 | pseudo_keycode = S(keycode); | ||
112 | } else { | ||
113 | pseudo_keycode = keycode; | ||
114 | } | ||
115 | break; | ||
116 | } | ||
117 | return pseudo_keycode; | ||
118 | } | ||
119 | |||
120 | uint8_t get_shift_bit(uint16_t keycode) { | ||
121 | if ((keycode >> 3) < SHIFT_BIT_SIZE) { | ||
122 | return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); | ||
123 | } else { | ||
124 | dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); | ||
125 | return 0; | ||
126 | } | ||
127 | } | ||
128 | |||
129 | void add_shift_bit(uint16_t keycode) { | ||
130 | if ((keycode >> 3) < SHIFT_BIT_SIZE) { | ||
131 | send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); | ||
132 | } else { | ||
133 | dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); | ||
134 | } | ||
135 | } | ||
136 | |||
137 | void del_shift_bit(uint16_t keycode) { | ||
138 | if ((keycode >> 3) < SHIFT_BIT_SIZE) { | ||
139 | send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); | ||
140 | } else { | ||
141 | dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); | ||
142 | } | ||
143 | } | ||
diff --git a/keyboards/comet46/keymaps/satt/action_pseudo_lut.h b/keyboards/comet46/keymaps/satt/action_pseudo_lut.h new file mode 100644 index 000000000..681252440 --- /dev/null +++ b/keyboards/comet46/keymaps/satt/action_pseudo_lut.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef ACTION_PSEUDO_LUT_H | ||
2 | #define ACTION_PSEUDO_LUT_H | ||
3 | |||
4 | #define SHIFT_BIT_SIZE (0xE7 / 8 + 1) // 1bit per 1key | ||
5 | |||
6 | #define IS_LSFT(kc) ((QK_LSFT & (kc)) == QK_LSFT) | ||
7 | |||
8 | void action_pseudo_lut(keyrecord_t *, uint8_t, const uint16_t (*)[2]); | ||
9 | uint16_t convert_keycode(const uint16_t (*)[2], uint16_t, bool); | ||
10 | |||
11 | uint8_t get_shift_bit(uint16_t); | ||
12 | void add_shift_bit(uint16_t); | ||
13 | void del_shift_bit(uint16_t); | ||
14 | |||
15 | #endif | ||
diff --git a/keyboards/comet46/keymaps/satt/config.h b/keyboards/comet46/keymaps/satt/config.h new file mode 100644 index 000000000..a3ca2ebfe --- /dev/null +++ b/keyboards/comet46/keymaps/satt/config.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | This is the c configuration file for the keymap | ||
3 | |||
4 | Copyright 2012 Jun Wako <[email protected]> | ||
5 | Copyright 2015 Jack Humbert | ||
6 | |||
7 | This program is free software: you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation, either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #ifndef CONFIG_USER_H | ||
22 | #define CONFIG_USER_H | ||
23 | |||
24 | /* Use I2C or Serial */ | ||
25 | |||
26 | #define USE_I2C | ||
27 | #define SSD1306OLED | ||
28 | |||
29 | #endif | ||
diff --git a/keyboards/comet46/keymaps/satt/keymap.c b/keyboards/comet46/keymaps/satt/keymap.c new file mode 100644 index 000000000..57aa63593 --- /dev/null +++ b/keyboards/comet46/keymaps/satt/keymap.c | |||
@@ -0,0 +1,288 @@ | |||
1 | // this is the style you want to emulate. | ||
2 | // This is the canonical layout file for the Quantum project. If you want to add another keyboard, | ||
3 | |||
4 | #include QMK_KEYBOARD_H | ||
5 | #include "keymap_jis2us.h" | ||
6 | #include "action_pseudo_lut.h" | ||
7 | #include "keymap_jp.h" | ||
8 | #ifdef SSD1306OLED | ||
9 | #include "ssd1306.h" | ||
10 | #endif | ||
11 | |||
12 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
13 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
14 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
15 | // entirely and just use numbers. | ||
16 | enum comet46_layers { | ||
17 | _QWERTY, | ||
18 | _LOWER, | ||
19 | _RAISE, | ||
20 | _PSEUDO_US, | ||
21 | _PSEUDO_US_LOWER, | ||
22 | _PSEUDO_US_RAISE, | ||
23 | _ADJUST | ||
24 | }; | ||
25 | |||
26 | enum custom_keycodes { | ||
27 | QWERTY = SAFE_RANGE, | ||
28 | PSEUDO_US, | ||
29 | JIS2US, | ||
30 | }; | ||
31 | |||
32 | // JIS keycodes | ||
33 | #define KC_JZHT JP_ZKHK // hankaku/zenkaku|kanzi | ||
34 | #define KC_JCIR JP_CIRC // ^, ~ | ||
35 | #define KC_JAT JP_AT // @, ` | ||
36 | #define KC_JLBR JP_LBRC // [, { | ||
37 | #define KC_JCOL JP_COLN // :, * | ||
38 | #define KC_JRBR JP_RBRC // ], } | ||
39 | #define KC_JBSL JP_BSLS // \, _ | ||
40 | #define KC_JMHE JP_MHEN // muhenkan | ||
41 | #define KC_JHEN JP_HENK // henkan | ||
42 | #define KC_JKAN JP_KANA // katakana/hiragana|ro-mazi | ||
43 | #define KC_JMKA JP_LANG1 //kana on MacOSX | ||
44 | #define KC_JMEI KC_LANG2 //eisu on MacOSX | ||
45 | #define KC_JAMP JP_AMPR // & | ||
46 | #define KC_JQUO JP_QUOT // ' | ||
47 | #define KC_JLPR JP_LPRN // ( | ||
48 | #define KC_JRPR JP_RPRN // ) | ||
49 | #define KC_JEQL JP_EQL // = | ||
50 | #define KC_JTIL JP_TILD // ~ | ||
51 | #define KC_JPIP JP_PIPE // | | ||
52 | #define KC_JGRV JP_GRV // ` | ||
53 | #define KC_JLCB JP_LCBR // { | ||
54 | #define KC_JPLU JP_PLUS // + | ||
55 | #define KC_JAST JP_ASTR // * | ||
56 | #define KC_JRCB JP_RCBR // } | ||
57 | #define KC_JUND JP_UNDS // _ | ||
58 | |||
59 | // Layer related keycodes | ||
60 | #define KC_LWR MO(_LOWER) | ||
61 | #define KC_RSE MO(_RAISE) | ||
62 | #define KC_P_LW MO(_PSEUDO_US_LOWER) | ||
63 | #define KC_P_RS MO(_PSEUDO_US_RAISE) | ||
64 | #define KC_QWRT QWERTY | ||
65 | #define KC_P_US PSEUDO_US | ||
66 | #define KC_J2US JIS2US | ||
67 | |||
68 | // Special keycodes | ||
69 | #define KC_SPCT CTL_T(KC_SPC) | ||
70 | #define KC_ENSF SFT_T(KC_ENT) | ||
71 | #define KC_CAEC MT(MOD_LCTL | MOD_LALT, KC_ESC) | ||
72 | #define KC_CSTB C_S_T(KC_TAB) | ||
73 | #define KC_IMON ALT_T(KC_F13) | ||
74 | #define KC_IMOF GUI_T(KC_F14) | ||
75 | #define KC_CAD LCA(KC_DEL) | ||
76 | #define KC_RST RESET | ||
77 | |||
78 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
79 | |||
80 | [_QWERTY] = LAYOUT( | ||
81 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
82 | KC_CAEC, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_DEL , | ||
83 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
84 | KC_CSTB, KC_A , KC_S , KC_D , KC_F , KC_G ,KC_LPRN, KC_RPRN, KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_BSPC, | ||
85 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
86 | KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_LBRC, KC_RBRC, KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_QUOT, | ||
87 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
88 | KC_IMOF,KC_LWR ,KC_SPCT, KC_ENSF,KC_RSE ,KC_IMON | ||
89 | // +----+----+---/ \---+----+----+ | ||
90 | ), | ||
91 | |||
92 | [_LOWER] = LAYOUT( | ||
93 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
94 | _______,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______, | ||
95 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
96 | _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_GRV ,KC_BSLS,KC_MINS,KC_EQL ,KC_LBRC,KC_RBRC,_______, | ||
97 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
98 | _______, KC_F7 , KC_F8 , KC_F9 , KC_F10, KC_F11, KC_F12, KC_TILD,KC_PIPE,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,_______, | ||
99 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
100 | _______,_______,_______, _______,_______,_______ | ||
101 | // +----+----+---/ \---+----+----+ | ||
102 | ), | ||
103 | |||
104 | [_RAISE] = LAYOUT( | ||
105 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
106 | _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,_______, | ||
107 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
108 | _______,_______,_______,_______,_______,_______,_______, XXXXXXX,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT,KC_END ,_______, | ||
109 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
110 | _______,_______,_______,_______,_______,_______,_______, KC_HOME,XXXXXXX,KC_PGDN,KC_PGUP,XXXXXXX,XXXXXXX,_______, | ||
111 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
112 | _______,_______,_______, _______,_______,_______ | ||
113 | // +----+----+---/ \---+----+----+ | ||
114 | ), | ||
115 | |||
116 | [_PSEUDO_US] = LAYOUT( | ||
117 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
118 | KC_CAEC, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_DEL , | ||
119 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
120 | KC_CSTB, KC_A , KC_S , KC_D , KC_F , KC_G ,KC_JLPR, KC_JRPR, KC_H , KC_J , KC_K , KC_L ,KC_J2US,KC_BSPC, | ||
121 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
122 | KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_J2US, KC_J2US, KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_J2US, | ||
123 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
124 | KC_IMOF,KC_P_LW,KC_SPCT, KC_ENSF,KC_P_RS,KC_IMON | ||
125 | // +----+----+---/ \---+----+----+ | ||
126 | ), | ||
127 | |||
128 | |||
129 | [_PSEUDO_US_LOWER] = LAYOUT( | ||
130 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
131 | _______,KC_EXLM,KC_JAT ,KC_HASH,KC_DLR ,KC_PERC, KC_JCIR,KC_JAMP,KC_JAST,KC_JLPR,KC_JRPR,_______, | ||
132 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
133 | _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_JGRV,KC_JBSL,KC_MINS,KC_JEQL,KC_JLBR,KC_JRBR,_______, | ||
134 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
135 | _______, KC_F7 , KC_F8 , KC_F9 , KC_F10, KC_F11, KC_F12, KC_JTIL,KC_JPIP,KC_JUND,KC_JPLU,KC_JLCB,KC_JRCB,_______, | ||
136 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
137 | _______,_______,_______, _______,_______,_______ | ||
138 | // +----+----+---/ \---+----+----+ | ||
139 | ), | ||
140 | |||
141 | [_PSEUDO_US_RAISE] = LAYOUT( | ||
142 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
143 | _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,_______, | ||
144 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
145 | _______,_______,_______,_______,_______,_______,KC_JZHT, XXXXXXX,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT,KC_END ,_______, | ||
146 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
147 | _______,_______,_______,_______,_______,_______,_______, KC_HOME,XXXXXXX,KC_PGDN,KC_PGUP,XXXXXXX,XXXXXXX,_______, | ||
148 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
149 | _______,_______,_______, _______,_______,_______ | ||
150 | // +----+----+---/ \---+----+----+ | ||
151 | ), | ||
152 | |||
153 | [_ADJUST] = LAYOUT( | ||
154 | //,----+----+----+----+----+----+ +----+----+----+----+----+----. | ||
155 | _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, | ||
156 | //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| | ||
157 | _______,_______,_______,_______,_______,_______,KC_CAD , KC_QWRT,_______,_______,_______,_______,_______,_______, | ||
158 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
159 | _______,_______,_______,_______,_______,_______,KC_RST , KC_P_US,_______,_______,_______,_______,_______,_______, | ||
160 | //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| | ||
161 | _______,_______,_______, _______,_______,_______ | ||
162 | // +----+----+---/ \---+----+----+ | ||
163 | ) | ||
164 | |||
165 | }; | ||
166 | |||
167 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
168 | switch (biton32(state)) { | ||
169 | case _PSEUDO_US_LOWER: | ||
170 | case _PSEUDO_US_RAISE: | ||
171 | return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); | ||
172 | break; | ||
173 | default: | ||
174 | return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); | ||
175 | break; | ||
176 | } | ||
177 | } | ||
178 | |||
179 | //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h | ||
180 | #ifdef SSD1306OLED | ||
181 | |||
182 | // You need to add source files to SRC in rules.mk when using OLED display functions | ||
183 | void set_keylog(uint16_t keycode); | ||
184 | const char *read_keylog(void); | ||
185 | const char *read_modifier_state(void); | ||
186 | const char *read_host_led_state(void); | ||
187 | |||
188 | void matrix_init_user(void) { | ||
189 | iota_gfx_init(false); // turns on the display | ||
190 | } | ||
191 | |||
192 | void matrix_scan_user(void) { | ||
193 | iota_gfx_task(); // this is what updates the display continuously | ||
194 | } | ||
195 | |||
196 | void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { | ||
197 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
198 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
199 | dest->dirty = true; | ||
200 | } | ||
201 | } | ||
202 | |||
203 | void render_status(struct CharacterMatrix *matrix) { | ||
204 | // Layer state | ||
205 | char layer_str[22]; | ||
206 | matrix_write(matrix, "Layer: "); | ||
207 | uint8_t layer = biton32(layer_state); | ||
208 | uint8_t default_layer = biton32(eeconfig_read_default_layer()); | ||
209 | switch (layer) { | ||
210 | case _QWERTY: | ||
211 | switch (default_layer) { | ||
212 | case _QWERTY: | ||
213 | snprintf(layer_str, sizeof(layer_str), "Qwerty"); | ||
214 | break; | ||
215 | case _PSEUDO_US: | ||
216 | snprintf(layer_str, sizeof(layer_str), "Psuedo_US"); | ||
217 | break; | ||
218 | default: | ||
219 | snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer); | ||
220 | break; | ||
221 | } | ||
222 | break; | ||
223 | case _RAISE: | ||
224 | snprintf(layer_str, sizeof(layer_str), "Raise"); | ||
225 | break; | ||
226 | case _LOWER: | ||
227 | snprintf(layer_str, sizeof(layer_str), "Lower"); | ||
228 | break; | ||
229 | case _PSEUDO_US_RAISE: | ||
230 | snprintf(layer_str, sizeof(layer_str), "P_US_Raise"); | ||
231 | break; | ||
232 | case _PSEUDO_US_LOWER: | ||
233 | snprintf(layer_str, sizeof(layer_str), "P_US_Lower"); | ||
234 | break; | ||
235 | case _ADJUST: | ||
236 | snprintf(layer_str, sizeof(layer_str), "Adjust"); | ||
237 | break; | ||
238 | default: | ||
239 | snprintf(layer_str, sizeof(layer_str), "Undef-%d", layer); | ||
240 | } | ||
241 | matrix_write_ln(matrix, layer_str); | ||
242 | // Last entered keycode | ||
243 | matrix_write_ln(matrix, read_keylog()); | ||
244 | // Modifier state | ||
245 | matrix_write_ln(matrix, read_modifier_state()); | ||
246 | // Host Keyboard LED Status | ||
247 | matrix_write(matrix, read_host_led_state()); | ||
248 | } | ||
249 | |||
250 | void iota_gfx_task_user(void) { | ||
251 | struct CharacterMatrix matrix; | ||
252 | |||
253 | #if DEBUG_TO_SCREEN | ||
254 | if (debug_enable) { | ||
255 | return; | ||
256 | } | ||
257 | #endif | ||
258 | |||
259 | matrix_clear(&matrix); | ||
260 | render_status(&matrix); | ||
261 | matrix_update(&display, &matrix); | ||
262 | } | ||
263 | |||
264 | #endif//SSD1306OLED | ||
265 | |||
266 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
267 | #ifdef SSD1306OLED | ||
268 | if (record->event.pressed) { | ||
269 | set_keylog(keycode); | ||
270 | } | ||
271 | #endif | ||
272 | switch (keycode) { | ||
273 | case QWERTY: | ||
274 | if (record->event.pressed) { | ||
275 | set_single_persistent_default_layer(_QWERTY); | ||
276 | } | ||
277 | break; | ||
278 | case PSEUDO_US: | ||
279 | if (record->event.pressed) { | ||
280 | set_single_persistent_default_layer(_PSEUDO_US); | ||
281 | } | ||
282 | break; | ||
283 | case JIS2US: | ||
284 | action_pseudo_lut(record, _QWERTY, keymap_jis2us); | ||
285 | break; | ||
286 | } | ||
287 | return true; | ||
288 | } | ||
diff --git a/keyboards/comet46/keymaps/satt/keymap_jis2us.h b/keyboards/comet46/keymaps/satt/keymap_jis2us.h new file mode 100644 index 000000000..e32a0579a --- /dev/null +++ b/keyboards/comet46/keymaps/satt/keymap_jis2us.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef KEYMAP_JIS2US_H | ||
2 | #define KEYMAP_JIS2US_H | ||
3 | |||
4 | /* keymap for convert from JIS to US */ | ||
5 | const uint16_t PROGMEM keymap_jis2us[][2] = { | ||
6 | [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ | ||
7 | |||
8 | [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ | ||
9 | [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ | ||
10 | [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ | ||
11 | [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ | ||
12 | [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ | ||
13 | [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ | ||
14 | [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ | ||
15 | [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ | ||
16 | [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ | ||
17 | [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ | ||
18 | [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ | ||
19 | [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ | ||
20 | [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ | ||
21 | [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ | ||
22 | [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ | ||
23 | [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ | ||
24 | [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ | ||
25 | [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ | ||
26 | [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ | ||
27 | [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ | ||
28 | [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ | ||
29 | [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ | ||
30 | }; | ||
31 | |||
32 | #endif | ||
diff --git a/keyboards/comet46/keymaps/satt/readme.md b/keyboards/comet46/keymaps/satt/readme.md new file mode 100644 index 000000000..33bbad326 --- /dev/null +++ b/keyboards/comet46/keymaps/satt/readme.md | |||
@@ -0,0 +1,6 @@ | |||
1 | ## Pseudo US Layout | ||
2 | |||
3 | On a Japanese Windows environment, ANSI keyboards may be recognized wrongly as a JIS keyboard. | ||
4 | By using this code, you can use your ANSI keyboard under a JIS keyboard environment without changing the settings and registry of your environment. | ||
5 | |||
6 | Original code by [Shela](https://github.com/qmk/qmk_firmware/tree/master/keyboards/hhkb/keymaps/shela) | ||
diff --git a/keyboards/comet46/keymaps/satt/rules.mk b/keyboards/comet46/keymaps/satt/rules.mk new file mode 100644 index 000000000..91609dd4f --- /dev/null +++ b/keyboards/comet46/keymaps/satt/rules.mk | |||
@@ -0,0 +1,8 @@ | |||
1 | SRC += action_pseudo_lut.c | ||
2 | |||
3 | # If you want to change display settings of the OLED, you need to change the following lines | ||
4 | SRC += ./lib/glcdfont.c \ | ||
5 | ./lib/keylogger.c \ | ||
6 | ./lib/modifier_state_reader.c \ | ||
7 | ./lib/host_led_state_reader.c | ||
8 | |||