aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/crkbd/keymaps/vayashiko/config.h42
-rw-r--r--keyboards/crkbd/keymaps/vayashiko/keymap.c182
-rw-r--r--keyboards/crkbd/keymaps/vayashiko/rules.mk31
3 files changed, 255 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/vayashiko/config.h b/keyboards/crkbd/keymaps/vayashiko/config.h
new file mode 100644
index 000000000..dd6cca89e
--- /dev/null
+++ b/keyboards/crkbd/keymaps/vayashiko/config.h
@@ -0,0 +1,42 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23//#define USE_MATRIX_I2C
24
25/* Select hand configuration */
26
27#define MASTER_LEFT
28// #define MASTER_RIGHT
29// #define EE_HANDS
30
31
32
33#define TAPPING_FORCE_HOLD
34#define TAPPING_TERM 100
35
36#undef RGBLED_NUM
37#define RGBLIGHT_ANIMATIONS
38#define RGBLED_NUM 42
39#define RGBLIGHT_LIMIT_VAL 120
40#define RGBLIGHT_HUE_STEP 10
41#define RGBLIGHT_SAT_STEP 17
42#define RGBLIGHT_VAL_STEP 17
diff --git a/keyboards/crkbd/keymaps/vayashiko/keymap.c b/keyboards/crkbd/keymaps/vayashiko/keymap.c
new file mode 100644
index 000000000..e9befa555
--- /dev/null
+++ b/keyboards/crkbd/keymaps/vayashiko/keymap.c
@@ -0,0 +1,182 @@
1/*
2Copyright 2019 @foostan
3Copyright 2020 Drashna Jaelre <@drashna>
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 2 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#include QMK_KEYBOARD_H
20#include "keymap_jp.h"
21
22enum custom_layers {
23 _QWERTY,
24 _LOWER,
25 _RAISE,
26 _ADJUST,
27};
28
29const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
30 [_QWERTY] = LAYOUT_split_3x6_3(
31 //,-----------------------------------------------------. ,-----------------------------------------------------.
32 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
33 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
34 KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
35 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
36 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
37 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
38 KC_LCTRL, MO(1), KC_SPC, KC_ENT, MO(2), KC_RALT
39 //`--------------------------' `--------------------------'
40
41 ),
42
43 [_LOWER] = LAYOUT_split_3x6_3(
44 //,-----------------------------------------------------. ,-----------------------------------------------------.
45 KC_DELETE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, KC_7, KC_8, KC_9, JP_MINS,KC_DELETE,
46 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
47 KC_LALT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, KC_4, KC_5, KC_6, JP_PLUS,LSFT(KC_CAPS),
48 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
49 KC_LSFT, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_0, KC_1, KC_2, KC_3, KC_DOT, KC_RSFT,
50 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
51 KC_LCTRL, _______, KC_SPC, KC_ENT, MO(3), KC_RALT
52 //`--------------------------' `--------------------------'
53 ),
54
55 [_RAISE] = LAYOUT_split_3x6_3(
56 //,-----------------------------------------------------. ,-----------------------------------------------------.
57 KC_ESC, JP_EXLM, JP_DQT, JP_HASH, KC_DLR, JP_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_MINS, JP_CIRC,
58 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
59 KC_LCTL, KC_GRV, XXXXXXX, XXXXXXX, KC_MHEN, KC_G, XXXXXXX, KC_HENK, JP_LBRC, JP_RBRC, XXXXXXX, JP_YEN,
60 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
61 KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, JP_EQL,JP_AT,LSFT(JP_LBRC),LSFT(JP_RBRC),XXXXXXX,JP_UNDS,
62 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
63 KC_LGUI, MO(3), KC_SPC, KC_ENT, _______, KC_RALT
64 //`--------------------------' `--------------------------'
65 ),
66
67 [_ADJUST] = LAYOUT_split_3x6_3(
68 //,-----------------------------------------------------. ,-----------------------------------------------------.
69 KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX,
70 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
71 KC_LCTL, KC_HOME, KC_S, XXXXXXX, KC_END, KC_G, XXXXXXX, KC_LEFT, KC_DOWN,KC_RIGHT, XXXXXXX, XXXXXXX,
72 //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
73 KC_LSFT, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DOWN, XXXXXXX, XXXXXXX, KC_RSFT,
74 //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
75 KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT
76 //`--------------------------' `--------------------------'
77 )
78};
79
80#ifdef OLED_DRIVER_ENABLE
81oled_rotation_t oled_init_user(oled_rotation_t rotation) {
82 if (!is_master) {
83 return OLED_ROTATION_180; // flips the display 180 degrees if offhand
84 }
85 return rotation;
86}
87
88#define L_BASE 0
89#define L_LOWER 2
90#define L_RAISE 4
91#define L_ADJUST 8
92
93void oled_render_layer_state(void) {
94 oled_write_P(PSTR("Layer: "), false);
95 switch (layer_state) {
96 case L_BASE:
97 oled_write_ln_P(PSTR("Default"), false);
98 break;
99 case L_LOWER:
100 oled_write_ln_P(PSTR("Lower"), false);
101 break;
102 case L_RAISE:
103 oled_write_ln_P(PSTR("Raise"), false);
104 break;
105 case L_ADJUST:
106 case L_ADJUST|L_LOWER:
107 case L_ADJUST|L_RAISE:
108 case L_ADJUST|L_LOWER|L_RAISE:
109 oled_write_ln_P(PSTR("Adjust"), false);
110 break;
111 }
112}
113
114
115char keylog_str[24] = {};
116
117const char code_to_name[60] = {
118 ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
119 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
120 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
121 '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
122 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
123 '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
124
125void set_keylog(uint16_t keycode, keyrecord_t *record) {
126 char name = ' ';
127 if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
128 (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
129 if (keycode < 60) {
130 name = code_to_name[keycode];
131 }
132
133 // update keylog
134 snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
135 record->event.key.row, record->event.key.col,
136 keycode, name);
137}
138
139void oled_render_keylog(void) {
140 oled_write(keylog_str, false);
141}
142
143void render_bootmagic_status(bool status) {
144 /* Show Ctrl-Gui Swap options */
145 static const char PROGMEM logo[][2][3] = {
146 {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
147 {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
148 };
149 if (status) {
150 oled_write_ln_P(logo[0][0], false);
151 oled_write_ln_P(logo[0][1], false);
152 } else {
153 oled_write_ln_P(logo[1][0], false);
154 oled_write_ln_P(logo[1][1], false);
155 }
156}
157
158void oled_render_logo(void) {
159 static const char PROGMEM crkbd_logo[] = {
160 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
161 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
162 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
163 0};
164 oled_write_P(crkbd_logo, false);
165}
166
167void oled_task_user(void) {
168 if (is_master) {
169 oled_render_layer_state();
170 oled_render_keylog();
171 } else {
172 oled_render_logo();
173 }
174}
175
176bool process_record_user(uint16_t keycode, keyrecord_t *record) {
177 if (record->event.pressed) {
178 set_keylog(keycode, record);
179 }
180 return true;
181}
182#endif // OLED_DRIVER_ENABLE
diff --git a/keyboards/crkbd/keymaps/vayashiko/rules.mk b/keyboards/crkbd/keymaps/vayashiko/rules.mk
new file mode 100644
index 000000000..16deaf45d
--- /dev/null
+++ b/keyboards/crkbd/keymaps/vayashiko/rules.mk
@@ -0,0 +1,31 @@
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 = no # 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 = yes # Enable WS2812 RGB underlight.
18SWAP_HANDS_ENABLE = no # Enable one-hand typing
19
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22
23# If you want to change the display of OLED, you need to change here
24SRC += ./lib/glcdfont.c \
25 ./lib/rgb_state_reader.c \
26 ./lib/layer_state_reader.c \
27 ./lib/logo_reader.c \
28 ./lib/keylogger.c \
29 # ./lib/mode_icon_reader.c \
30 # ./lib/host_led_state_reader.c \
31 # ./lib/timelogger.c \