aboutsummaryrefslogtreecommitdiff
path: root/keyboards/zinc/keymaps/monks
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/zinc/keymaps/monks')
-rw-r--r--keyboards/zinc/keymaps/monks/config.h38
-rw-r--r--keyboards/zinc/keymaps/monks/keymap.c255
-rw-r--r--keyboards/zinc/keymaps/monks/readme_jp.md103
-rw-r--r--keyboards/zinc/keymaps/monks/rules.mk100
4 files changed, 496 insertions, 0 deletions
diff --git a/keyboards/zinc/keymaps/monks/config.h b/keyboards/zinc/keymaps/monks/config.h
new file mode 100644
index 000000000..4dcb0724f
--- /dev/null
+++ b/keyboards/zinc/keymaps/monks/config.h
@@ -0,0 +1,38 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2018 monksoffunk
5Copyright 2012 Jun Wako <wakojun@gmail.com>
6Copyright 2015 Jack Humbert
7
8This program is free software: you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation, either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#pragma once
23// if you need more program area, try uncomment follow line
24#include "serial_config_simpleapi.h"
25
26// place overrides here
27// Selection of RGBLIGHT MODE to use.
28#if defined(LED_ANIMATIONS)
29 #define RGBLIGHT_EFFECT_BREATHING
30 #define RGBLIGHT_EFFECT_RAINBOW_MOOD
31 #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
32 #define RGBLIGHT_EFFECT_SNAKE
33 #define RGBLIGHT_EFFECT_KNIGHT
34 #define RGBLIGHT_EFFECT_CHRISTMAS
35 #define RGBLIGHT_EFFECT_STATIC_GRADIENT
36 //#define RGBLIGHT_EFFECT_RGB_TEST
37 //#define RGBLIGHT_EFFECT_ALTERNATING
38#endif
diff --git a/keyboards/zinc/keymaps/monks/keymap.c b/keyboards/zinc/keymaps/monks/keymap.c
new file mode 100644
index 000000000..5fd7c6aa8
--- /dev/null
+++ b/keyboards/zinc/keymaps/monks/keymap.c
@@ -0,0 +1,255 @@
1#include QMK_KEYBOARD_H
2
3extern keymap_config_t keymap_config;
4
5#ifdef RGBLIGHT_ENABLE
6//Following line allows macro to read current RGB settings
7extern rgblight_config_t rgblight_config;
8rgblight_config_t RGB_current_config;
9#endif
10
11extern uint8_t is_master;
12
13// Each layer gets a name for readability, which is then used in the keymap matrix below.
14// The underscores don't mean anything - you can have a layer called STUFF or any other name.
15// Layer names don't all need to be of the same length, obviously, and you can also skip them
16// entirely and just use numbers.
17enum layer_number {
18 _QWERTY = 0,
19 _LOWER,
20 _RAISE,
21 _ADJUST
22};
23
24enum custom_keycodes {
25 QWERTY = SAFE_RANGE,
26 COLEMAK,
27 DVORAK,
28 LOWER,
29 RAISE,
30 ADJUST,
31 BACKLIT,
32 KANA,
33 EISU,
34 RGBRST
35};
36
37enum macro_keycodes {
38 KC_SAMPLEMACRO,
39};
40
41
42//Macros
43#define M_SAMPLE M(KC_SAMPLEMACRO)
44
45const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { \
46 /* Qwerty
47 * ,-----------------------------------------. ,-----------------------------------------.
48 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
49 * |------+------+------+------+------+------| |------+------+------+------+------+------|
50 * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' |
51 * |------+------+------+------+------+------| |------+------+------+------+------+------|
52 * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter |
53 * |------+------+------+------+------+------| |------+------+------+------+------+------|
54 * | Esc |ADJUST| Alt | GUI |LOWER |Space | | Space| RAISE| KANA | Left | Down | Right|
55 * `-----------------------------------------' `-----------------------------------------'
56 */
57[_QWERTY] = LAYOUT_ortho_4x12(
58 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
59 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
60 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
61 KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_RGHT \
62 ),
63
64 /* Lower
65 * ,-----------------------------------------. ,-----------------------------------------.
66 * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
67 * |------+------+------+------+------+------| |------+------+------+------+------+------|
68 * | | | | | | | | - | _ | + | { | } | | |
69 * |------+------+------+------+------+------| |------+------+------+------+------+------|
70 * | | | | | | | | | | | | UP | |
71 * |------+------+------+------+------+------| |------+------+------+------+------+------|
72 * | | | | | | | | | | | | | |
73 * `-----------------------------------------' `-----------------------------------------'
74 */
75 [_LOWER] = LAYOUT_ortho_4x12( \
76 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \
77 _______, _______, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
78 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, \
79 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
80 ),
81
82 /* Raise
83 * ,-----------------------------------------. ,-----------------------------------------.
84 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del |
85 * |------+------+------+------+------+------| |------+------+------+------+------+------|
86 * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
87 * |------+------+------+------+------+------| |------+------+------+------+------+------|
88 * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | ? | |
89 * |------+------+------+------+------+------| |------+------+------+------+------+------|
90 * | | | | | | | | | | Next | Vol- | Vol+ | Play |
91 * `-----------------------------------------' `-----------------------------------------'
92 */
93 [_RAISE] = LAYOUT_ortho_4x12( \
94 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
95 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
96 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, S(KC_SLSH), _______, \
97 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
98 ),
99
100 /* Adjust (Lower + Raise)
101 * ,-----------------------------------------. ,-----------------------------------------.
102 * | | Reset|RGBRST| | | | | | | | | | Ins |
103 * |------+------+------+------+------+------| |------+------+------+------+------+------|
104 * | |RGB ON| HUE+ | SAT+ | VAL+ | Mac | | Win | - | = |Print |ScLock|Pause |
105 * |------+------+------+------+------+------| |------+------+------+------+------+------|
106 * | | MODE | HUE- | SAT- | VAL- | | | | | | |PageUp| |
107 * |------+------+------+------+------+------| |------+------+------+------+------+------|
108 * | | | | EISU | EISU | EISU | | KANA | KANA | KANA | Home |PageDn| End |
109 * `-----------------------------------------' `-----------------------------------------'
110 */
111 [_ADJUST] = LAYOUT_ortho_4x12( \
112 _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \
113 _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, AG_NORM, AG_SWAP, KC_MINS, KC_EQL, KC_PSCR, KC_SLCK, KC_PAUS,\
114 _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, KC_PGUP, _______,\
115 _______, _______, _______, EISU, EISU, EISU, KANA, KANA, KANA, KC_HOME, KC_PGDN, KC_END\
116 )
117};
118
119// define variables for reactive RGB
120bool TOG_STATUS = false;
121
122// Setting ADJUST layer RGB back to default
123void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
124 if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
125 #ifdef RGBLIGHT_ENABLE
126 rgblight_mode_noeeprom(RGB_current_config.mode);
127 #endif
128 layer_on(layer3);
129 } else {
130 layer_off(layer3);
131 }
132}
133
134bool process_record_user(uint16_t keycode, keyrecord_t *record) {
135 switch (keycode) {
136 case QWERTY:
137 if (record->event.pressed) {
138 set_single_persistent_default_layer(_QWERTY);
139 }
140 return false;
141 break;
142
143 case LOWER:
144 if (record->event.pressed) {
145 //not sure how to have keyboard check mode and set it to a variable, so my work around
146 //uses another variable that would be set to true after the first time a reactive key is pressed.
147 if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
148 } else {
149 TOG_STATUS = !TOG_STATUS;
150 #ifdef RGBLIGHT_ENABLE
151 rgblight_mode_noeeprom(16);
152 #endif
153 }
154 layer_on(_LOWER);
155 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
156 } else {
157 #ifdef RGBLIGHT_ENABLE
158 rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change
159 #endif
160 TOG_STATUS = false;
161 layer_off(_LOWER);
162 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
163 }
164 return false;
165 break;
166
167 case RAISE:
168 if (record->event.pressed) {
169 //not sure how to have keyboard check mode and set it to a variable, so my work around
170 //uses another variable that would be set to true after the first time a reactive key is pressed.
171 if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
172 } else {
173 TOG_STATUS = !TOG_STATUS;
174 #ifdef RGBLIGHT_ENABLE
175 rgblight_mode_noeeprom(15);
176 #endif
177 }
178 layer_on(_RAISE);
179 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
180 } else {
181 #ifdef RGBLIGHT_ENABLE
182 rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change
183 #endif
184 layer_off(_RAISE);
185 TOG_STATUS = false;
186 update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
187 }
188 return false;
189 break;
190
191 case ADJUST:
192 if (record->event.pressed) {
193 layer_on(_ADJUST);
194 } else {
195 layer_off(_ADJUST);
196 }
197 return false;
198 break;
199 //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
200 case RGB_MOD:
201 #ifdef RGBLIGHT_ENABLE
202 if (record->event.pressed) {
203 rgblight_mode_noeeprom(RGB_current_config.mode);
204 rgblight_step();
205 RGB_current_config.mode = rgblight_config.mode;
206 }
207 #endif
208 return false;
209 break;
210
211 case EISU:
212 if (record->event.pressed) {
213 if(keymap_config.swap_lalt_lgui==false){
214 register_code(KC_LANG2);
215 }else{
216 SEND_STRING(SS_LALT("`"));
217 }
218 } else {
219 unregister_code(KC_LANG2);
220 }
221 return false;
222 break;
223 case KANA:
224 if (record->event.pressed) {
225 if(keymap_config.swap_lalt_lgui==false){
226 register_code(KC_LANG1);
227 }else{
228 SEND_STRING(SS_LALT("`"));
229 }
230 } else {
231 unregister_code(KC_LANG1);
232 }
233 return false;
234 break;
235
236 case RGBRST:
237 #ifdef RGBLIGHT_ENABLE
238 if (record->event.pressed) {
239 eeconfig_update_rgblight_default();
240 rgblight_enable();
241 RGB_current_config = rgblight_config;
242 }
243 #endif
244 break;
245 }
246 return true;
247}
248
249
250void matrix_init_user(void) {
251 #ifdef RGBLIGHT_ENABLE
252 rgblight_init();
253 RGB_current_config = rgblight_config;
254 #endif
255}
diff --git a/keyboards/zinc/keymaps/monks/readme_jp.md b/keyboards/zinc/keymaps/monks/readme_jp.md
new file mode 100644
index 000000000..680e2866c
--- /dev/null
+++ b/keyboards/zinc/keymaps/monks/readme_jp.md
@@ -0,0 +1,103 @@
1# monksoffunk's personal zinc Layout
2## 配列
3
4### Qwerty配列
5
6```
7 ,-----------------------------------------. ,-----------------------------------------.
8 | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
9 |------+------+------+------+------+------| |------+------+------+------+------+------|
10 | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' |
11 |------+------+------+------+------+------| |------+------+------+------+------+------|
12 | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter |
13 |------+------+------+------+------+------| |------+------+------+------+------+------|
14 | Esc |ADJUST| Alt | GUI |LOWER |Space | | Space| RAISE| KANA | Left | Down | Right|
15 `------------------------------------------ ------------------------------------------'
16```
17
18KANAキーを独立させ、UPキーをLOWER+スラッシュに当てています。そのほかデフォルトからレイヤーをかなりいじっています。
19また、RGB LEDがアンコメントしてありますので、実装していない場合はソースを見て適宜コメントアウトしてください。
20
21## コンパイルの仕方
22
23コンパイルは、qmk_firmware のトップディレクトリで行います。
24
25```
26$ cd qmk_firmware
27```
28qmk_firmwareでは各キーボードのコンパイルは、`<キーボード名>:<キーマップ名>`という指定で行います。
29
30```
31$ make zinc:monks
32```
33
34キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。
35
36```
37$ make zinc:monks:avrdude
38```
39
40コンパイル結果と中間生成物を消去したい場合は以下のようにします。
41
42```
43$ make zinc:monks:clean
44```
45
46なお、avrdudeではなくQMK Toolbox(GUIツール)を使う方法もあります。
47
48https://github.com/qmk/qmk_toolbox/releases
49
50その場合は、$ make zinc:monksでビルドした成果物をQMK Toolboxから指定してください。
51
52## カスタマイズ
53
54コマンドラインからオプションを指定してビルドすることが出来ます。
55
56```
57# Zinc keyboard 'monks' keymap: convenient command line option
58make ZINC=<options> zinc:monks
59# option= back | under | na | ios
60# ex.
61# make ZINC=under zinc:monks
62# make ZINC=under,ios zinc:monks
63# make ZINC=back zinc:monks
64# make ZINC=back,na zinc:monks
65# make ZINC=back,ios zinc:monks
66```
67
68あるいは`qmk_firmware/keyboards/zinc/rev1/keymaps/monks/rules.mk` の以下の部分を編集して機能を有効化してください。
69
70```
71# Zinc keyboard customize
72LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight)
73LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight)
74LED_ANIMATIONS = yes # LED animations
75IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone)
76
77
78```
79
80## RGB backlight を有効にする
81
82rules.mk の下記の部分を編集して no を yes に変更してください。
83```
84LED_BACK_ENABLE = yes # LED backlight (Enable SK6812mini backlight)
85```
86
87
88## RGB Underglow を有効にする
89
90rules.mk の下記の部分を編集して no を yes に変更してください。
91```
92LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight)
93```
94
95
96## iPad/iPhoneサポートを有効にする。
97
98rules.mk の下記の部分を編集して no を yes に変更してください。
99RBG Underglow や RGBバックライトの輝度を抑えて、iPad, iPhone にも接続できるようになります。
100
101```
102IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone)
103``` \ No newline at end of file
diff --git a/keyboards/zinc/keymaps/monks/rules.mk b/keyboards/zinc/keymaps/monks/rules.mk
new file mode 100644
index 000000000..a5335def8
--- /dev/null
+++ b/keyboards/zinc/keymaps/monks/rules.mk
@@ -0,0 +1,100 @@
1
2# Build Options
3# change to "no" to disable the options, or define them in the Makefile in
4# the appropriate keymap folder that will get included automatically
5#
6BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
7MOUSEKEY_ENABLE = no # Mouse keys(+4700)
8EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
9CONSOLE_ENABLE = no # Console for debug(+400)
10COMMAND_ENABLE = no # Commands for debug and configuration
11NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
12BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
13MIDI_ENABLE = no # MIDI controls
14AUDIO_ENABLE = no # Audio output on port C6
15UNICODE_ENABLE = no # Unicode
16BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
17RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
18SWAP_HANDS_ENABLE = no # Enable one-hand typing
19
20define ZINC_CUSTOMISE_MSG
21 $(info Zinc customize)
22 $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE))
23 $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE))
24 $(info - LED_ANIMATION=$(LED_ANIMATIONS))
25 $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE))
26endef
27
28# Zinc keyboard customize
29LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight)
30LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight)
31LED_ANIMATIONS = yes # LED animations
32IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone)
33Link_Time_Optimization = no # if firmware size over limit, try this option
34
35#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE.
36#### Do not enable these with audio at the same time.
37
38### Zinc keyboard 'default' keymap: convenient command line option
39## make ZINC=<options> zinc:defualt
40## option= back | under | na | ios
41## ex.
42## make ZINC=under zinc:defualt
43## make ZINC=under,ios zinc:defualt
44## make ZINC=back zinc:default
45## make ZINC=back,na zinc:default
46## make ZINC=back,ios zinc:default
47
48ifneq ($(strip $(ZINC)),)
49 ifeq ($(findstring back,$(ZINC)), back)
50 LED_BACK_ENABLE = yes
51 else ifeq ($(findstring under,$(ZINC)), under)
52 LED_UNDERGLOW_ENABLE = yes
53 endif
54 ifeq ($(findstring na,$(ZINC)), na)
55 LED_ANIMATIONS = no
56 endif
57 ifeq ($(findstring ios,$(ZINC)), ios)
58 IOS_DEVICE_ENABLE = yes
59 endif
60 $(eval $(call ZINC_CUSTOMISE_MSG))
61 $(info )
62endif
63
64ifeq ($(strip $(LED_BACK_ENABLE)), yes)
65 RGBLIGHT_ENABLE = yes
66 OPT_DEFS += -DRGBLED_BACK
67 ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
68 $(eval $(call ZINC_CUSTOMISE_MSG))
69 $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes')
70 endif
71else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes)
72 RGBLIGHT_ENABLE = yes
73else
74 RGBLIGHT_ENABLE = no
75endif
76
77ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes)
78 OPT_DEFS += -DIOS_DEVICE_ENABLE
79endif
80
81ifeq ($(strip $(LED_ANIMATIONS)), yes)
82# OPT_DEFS += -DRGBLIGHT_ANIMATIONS
83 OPT_DEFS += -DLED_ANIMATIONS
84endif
85
86ifeq ($(strip $(Link_Time_Optimization)),yes)
87 EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization
88endif
89
90# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
91SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
92
93ifndef QUANTUM_DIR
94 include ../../../../Makefile
95endif
96
97# Uncomment these for debugging
98# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE))
99# $(info -- OPT_DEFS=$(OPT_DEFS))
100# $(info )